Simplified Chinese Unicode table

后端 未结 6 1895
遥遥无期
遥遥无期 2020-12-05 12:45

Where can I find a Unicode table showing only the simplified Chinese characters? I have searched everywhere but cannot find anything.

UPDATE :
I

6条回答
  •  青春惊慌失措
    2020-12-05 13:15

    The OP doesn't indicate which language they're using, but if you're using Ruby, I've written a small library that can distinguish between simplified and traditional Chinese (plus Korean and Japanese as a bonus). As suggested in Greg's answer, it relies on a distilled version of Unihan_Variants.txt to figure out which chars are exclusively simplified and which are exclusively traditional.

    https://github.com/jpatokal/script_detector

    Sample:

    p string
    => "我的氣墊船充滿了鱔魚."
    > string.chinese?
    => true
    > string.traditional_chinese?
    => true
    > string.simplified_chinese?
    => false
    

    But as the Unicode FAQ duly warns, this requires sizable fragments of text to work reliably, and will give misleading results for short strings. Consider the Japanese for Tokyo:

    p string
    => "東京"
    > string.chinese?
    => true
    > string.traditional_chinese?
    => true
    > string.japanese?
    => false
    

    Since both characters happen to also be valid traditional Chinese, and there are no exclusively Japanese characters, it's not recognized correctly.

提交回复
热议问题