Message194075
As per the discussion here:
http://mail.python.org/pipermail/python-ideas/2013-July/022419.html
\N{} escapes should support the Unicode code point notation U+xxxx (where there are four, five or six hex digits after the U+).
E.g. '\N{U+03BB}' => 'λ'
unicodedata.lookup should also support such numeric names, e.g.:
unicodedata.lookup('U+03BB') => 'λ'
As '+' is otherwise prohibited in Unicode character names, there should never be ambiguity between 'U+xxxx' as a code point and an actual name, and a single lookup function can handle both.
(See http://www.unicode.org/versions/Unicode6.2.0/ch04.pdf#G39 for details on characters allowed in names.)
Also add a function for the reverse
unicodedata.codepoint('λ') => 'U+03BB'
def codepoint(c):
return 'U+{:04X}'.format(ord(c)) |
|
Date |
User |
Action |
Args |
2013-08-01 13:54:05 | steven.daprano | set | recipients:
+ steven.daprano, ezio.melotti |
2013-08-01 13:54:05 | steven.daprano | set | messageid: <1375365245.12.0.441428484785.issue18614@psf.upfronthosting.co.za> |
2013-08-01 13:54:05 | steven.daprano | link | issue18614 messages |
2013-08-01 13:54:04 | steven.daprano | create | |
|