why isn't Unicode the default encoding?

Jon Ribbens jon+usenet at unequivocal.co.uk
Tue Mar 21 06:02:51 EST 2006


In article <441f3f4f$0$29501$9b622d9e at news.freenet.de>, Martin v. Löwis wrote:
> In any case, it doesn't matter what encoding the document is in:
> read(2) always returns two bytes.

It returns *up to* two bytes. Sorry to be picky but I think it's
relevant to the topic because it illustrates how it's difficult
to change the definition of file.read() to return characters
instead of bytes (if the file is ready to read, there will always
be one or more bytes available (or EOF), but there won't always
be one or more characters available).



More information about the Python-list mailing list