Proposal: require 7-bit source str's

"Martin v. Löwis" martin at v.loewis.de
Sat Aug 7 01:28:19 EDT 2004


Neil Hodgson wrote:
>    Do you have a link to such an encoding? I understand 0x5c, '\' is often
> displayed as a yen sign, but haven't seen it as the start byte of a multi
> byte character.

The ISO-2022 ones:
 >>> u"\u69f9\u6a0c".encode("iso-2022-jp")
'\x1b$B\\_\\n\x1b(B'

ESC $ B and ESC ( B are the codeset switch sequences, and \_ \n are
the actual encodings of the characters.

>    Regarding the 's' string prefix in the proposal, adding more prefixes
> damages ease of understanding particularly when used in combination. There
> should be a very strong need before another is introduced: I'd really hate
> to be trying to work out the meaning of:
> 
> r$tu"/Raw/ $interpolated, translated Unicode string"

Indeed. Perhaps some combinations can be ruled out, though.

Regards,
Martin



More information about the Python-list mailing list