PEP263 (Specifying encoding) and bytecode strings

Tony Meyer ta-meyer at ihug.co.nz
Mon May 5 03:47:48 EDT 2003


> > Is there some way to specify that all strings are 
> > bytecodes, and not encoded characters?
> Couldn't resourcepackage just insert a suitable encoding 
> "declaration", which is after all a comment and thus 
> innocuous for any previous release of Python -- or else emit 
> non-ascii chars as escape sequences?

I probably phrased my question poorly: what, then, is the correct
encoding for the output of zlib.compress()?  I know IANA has a list [1]
of encodings, but it's not really clear which is the right one.

[zlib.compress() returns a string of '\xXX's, where XX is from 00 to
FF.]

I'm happy to admit that I know almost nothing about encodings.
Particularly, I don't see why '\xda' [2] is not considered ascii.  It
should be an upper case U with an acute, according to rfc1345 [3] -
isn't that what ascii is?

=Tony Meyer

[1] http://www.iana.org/assignments/character-sets
[2] '\xda' is an example of a character that the warning is given for.
[3] http://www.faqs.org/rfcs/rfc1345






More information about the Python-list mailing list