Fredrik Lundh wrote: > > > so let's change the question into a proposal: > > > > for maximum compatibility with 8-bit strings and SRE, > > let's change "\x" to mean "binary byte" in unicode string > > literals too. > > I've prepared a small patch. If nobody objects, I'll check > it in next weekend, or so... > > http://sourceforge.net/patch/index.php?func=detailpatch&patch_id=100912&group_id=5470 There were objections from Finn Bock and myself: \xXXXX is defined to mean "read all hex chars until the next non-hex char and then cast to the underlying type (char or wchar_t)" in C9X. Don't know about Java... Finn ? Not that this definition is optimal, but we should stick to what the standard says and only depreciate usage of \xXXXX in favour of \uXXXX. Code using escapes like "\xABCD" which then results in "\xCD" is broken anyway -- having u"\xABCD" return "\uABCD" wouldn't make much of a difference (+ the bug would become pretty obvious if viewed in a Unicode aware viewer: Asian characters are very easy to recognize in ASCII text ;-) Would it be hard to make JPython support \uXXXX ? (Or does it already ?) -- Marc-Andre Lemburg ______________________________________________________________________ Business: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4