[Python-Dev] Re: Regression in unicodestr.encode()? (original) (raw)

Guido van Rossum guido@python.org
Tue, 09 Apr 2002 18:57:27 -0400


[Barry A. Warsaw] > My very limited Tim-enlightened understanding is that encoding a string > to UTF-8 should never produce a string with NULs.

[Fran�ois]

Besides the fact that NULs encode to themselves. In fact, 0-127 encode to themselves, and are never produced otherwise. Also, 254 and 255 are never produced, I heard that some use these to escape out within an UTF-8 string.

Hm, but isn't there a way to encode a NUL that doesn't produce a NUL? In some variant?

--Guido van Rossum (home page: http://www.python.org/~guido/)