FAQ
I recenlty had the same issue, but clearing the build directory and rebuilding again fixed the issue for me
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-list/attachments/20060925/75ae4f2e/attachment.html

From http Mon Sep 25 09:45:29 2006
From: http (Paul Rubin)
Date: 25 Sep 2006 00:45:29 -0700
Subject: unicode, bytes redux
References: <mailman.552.1159166294.10491.python-list@python.org>
Message-ID: <7xy7s8crty.fsf@ruckus.brouhaha.com>

willie <willie at jamots.com> writes:
# U+270C
# 11100010 10011100 10001100
buf = "\xE2\x9C\x8C"
u = buf.decode('UTF-8')
# ... later ...
u.bytes() -> 3

(goes through each code point and calculates
the number of bytes that make up the character
according to the encoding)
Duncan Booth explains why that doesn't work. But I don't see any big
problem with a byte count function that lets you specify an encoding:

u = buf.decode('UTF-8')
# ... later ...
u.bytes('UTF-8') -> 3
u.bytes('UCS-4') -> 4

That avoids creating a new encoded string in memory, and for some
encodings, avoids having to scan the unicode string to add up the
lengths.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedSep 25, '06 at 3:22a
activeSep 25, '06 at 3:22a
posts1
users1
websitepython.org

1 user in discussion

Thomas Thomas: 1 post

People

Translate

site design / logo © 2022 Grokbase