Character encodings and codecs

vincent wehren v.wehren at
Sat Feb 1 16:17:09 CET 2003

"Grumfish" <nobody at> schrieb im Newsbeitrag
news:mmdn3vg4csgpkt8vtka2jhnit5kf6d3d72 at
> On Sat, 1 Feb 2003 08:43:17 +0100, "vincent wehren" <v.wehren at>
> wrote:
> >    Do you mean: reading chunks without accidentally breaking up
> Yes. how can I do this?

Well, that depends on the original encoding, doesn't it. If it is, let's
say, a DBCS character set you could maybe check if the last byte of the
chunk you read is within the leadbyte range of the input character set. If
the last one's it's a leading byte you know you need to read at least one
more byte to have the more to have the entire dbcs character. What encodings
do you want to process?

Vincent Wehren

More information about the Python-list mailing list