Message177416
Anatoly
> b'Русское имя' is not a valid syntax construct in Python 3 even though I have
> correct 'coding: utf-8' header and expect characters to be utf-8 bytes.
David
> The byte string vs the coding cookie is an interesting observation, but is a separate
> issue and should probably be raised on python-ideas, since I'm guessing it the
> current behavior was a conscious design choice.
Yes, it works as designed: the coding cookie is used to decode bytes to characters in unicode literals (e.g. if I have u'Éric' in my source file, not a \u escape); bytes literals are independent of the coding cookie and should always contain only bytes, not characters (including \u escapes), e.g. '\xc3\x89ric' for UTF-8 bytes. |
|
Date |
User |
Action |
Args |
2012-12-13 16:45:16 | eric.araujo | set | recipients:
+ eric.araujo, amaury.forgeotdarc, techtonik, jkloth, r.david.murray, serhiy.storchaka |
2012-12-13 16:45:16 | eric.araujo | set | messageid: <1355417116.83.0.622257255041.issue16656@psf.upfronthosting.co.za> |
2012-12-13 16:45:16 | eric.araujo | link | issue16656 messages |
2012-12-13 16:45:16 | eric.araujo | create | |
|