[Tutor] three numbers for one

eryksun eryksun at gmail.com
Tue Jun 11 18:38:56 CEST 2013


On Tue, Jun 11, 2013 at 10:21 AM, Oscar Benjamin
<oscar.j.benjamin at gmail.com> wrote:
> What exactly are these? I tried looking for the HALFWIDTH DIGIT ZERO
> that you mentioned but I can't find it:

CJK typesetting uses the FULLWIDTH block for the ASCII range 0x21-0x7E:

    >>> '\N{FULLWIDTH DIGIT ONE}\N{FULLWIDTH DIGIT ZERO}'
    '10'
    >>> int('\N{FULLWIDTH DIGIT ONE}\N{FULLWIDTH DIGIT ZERO}')
    10

http://en.wikipedia.org/wiki/Halfwidth_and_Fullwidth_Forms

I'm pretty sure the HALFWIDTH characters for Katakana and Hangul are
used in combination with ASCII 0x20-0x7E.


>>>> int('\u4e00')
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ValueError: invalid literal for int() with base 10: '\u4e00'

int() requires a decimal string. The ideograph U+4e00 is only numeric:

    >>> '\u4e00'.isdecimal()
    False
    >>> '\u4e00'.isdigit()
    False
    >>> unicodedata.numeric('\u4e00')
    1.0

> (Also the Japanese numerals page shows a character 京 (kei) with a
> bigger numeric value than the 兆 (chō) character that Eryksun referred
> to earlier).

The Unicode database doesn't list 京 (U+4EAC) as numeric.

http://www.unicode.org/cgi-bin/GetUnihanData.pl?codepoint=4EAC

It's primary definition is capital city, with a secondary meaning of
1e16. If you follow the links in wiktionary you'll find ideographs for
even larger values such as 1e20, 1e24, and so on (grouped by 10,000).

http://en.wiktionary.org/wiki/%E4%BA%AC

I think in context it can refer to Beijing or Kyoto, but when combined
with "都" (metropolis), it's the proper name for Kyoto:

    In Japanese, the city has been called Kyō (京), Miyako (都) or
    Kyō no Miyako (京の都). In the 11th century, the city was renamed
    Kyoto ("capital city"), after the Chinese word for capital city,
    jingdu (京都). After Edo was renamed Tokyo (meaning "Eastern
    Capital") in 1868, Kyoto was known for a short time as Saikyō
    (西京, meaning "Western Capital").


More information about the Tutor mailing list