
May 26, 2011
11:15 a.m.
Terry Reedy, 26.05.2011 03:58:
If such a thing were added, the 256 bytes should directly map to the first 256 codepoints. I don't know if 'latin1' does that or not.
Yes, Unicode was specifically designed to support that. The first 128 code points are identical with the ASCII encoding, the first 256 code points are identical with the Latin-1 encoding. See also PEP 393, which exploits this feature. http://www.python.org/dev/peps/pep-0393/ That being said, I don't see the point of aliasing "latin-1" to "bytes" in the codecs. That sounds confusing to me. Stefan