Skip to content

If gb18030 is revised, consider aligning the Encoding Standard #27

Closed

Description

@lygstate

Cause GB18030-2005 is already one-to-one mapping bettween Unicode & GBK18030 except
The 14 characters that still mapped into Unicode PUA that at 2005,
But nowadays, all the 14 characters have correlated mapping into Unicode,
So I suggest encoding standard mapping those characters to normal Unicode characters but PUA characters.

The following 80 characters are the GBK chracters that ever mapped to Unicode PUA, and
the corresponding Unicode non-PUA character

Han Character      GBK              Unicode PUA       Unicode non-PUA
                FE50                E815                2E81
                FE51                E816                20087
                FE52                E817                20089
                FE53                E818                200CC
                FE54                E819                2E84
                FE55                E81A                3473
                FE56                E81B                3447
                FE57                E81C                2E88
                FE58                E81D                2E8B
                FE59                E81E                9FB4
                FE5A                E81F                359E
                FE5B                E820                361A
                FE5C                E821                360E
                FE5D                E822                2E8C
                FE5E                E823                2E97
                FE5F                E824                396E
                FE60                E825                3918
                FE61                E826                9FB5
                FE62                E827                39CF
                FE63                E828                39DF
                FE64                E829                3A73
                FE65                E82A                39D0
                FE66                E82B                9FB6
                FE67                E82C                9FB7
                FE68                E82D                3B4E
                FE69                E82E                3C6E
                FE6A                E82F                3CE0
                FE6B                E830                2EA7
                FE6C                E831                215D7
                FE6D                E832                9FB8
                FE6E                E833                2EAA
                FE6F                E834                4056
                FE70                E835                415F
                FE71                E836                2EAE
                FE72                E837                4337
                FE73                E838                2EB3
                FE74                E839                2EB6
                FE75                E83A                2EB7
                FE76                E83B                2298F
                FE77                E83C                43B1
                FE78                E83D                43AC
                FE79                E83E                2EBB
                FE7A                E83F                43DD
                FE7B                E840                44D6
                FE7C                E841                4661
                FE7D                E842                464C
                FE7E                E843                9FB9
                FE80                E844                4723
                FE81                E845                4729
                FE82                E846                477C
                FE83                E847                478D
                FE84                E848                2ECA
                FE85                E849                4947
                FE86                E84A                497A
                FE87                E84B                497D
                FE88                E84C                4982
                FE89                E84D                4983
                FE8A                E84E                4985
                FE8B                E84F                4986
                FE8C                E850                499F
                FE8D                E851                499B
                FE8E                E852                49B7
                FE8F                E853                49B6
                FE90                E854                9FBA
                FE91                E855                241FE
                FE92                E856                4CA3
                FE93                E857                4C9F
                FE94                E858                4CA0
                FE95                E859                4CA1
                FE96                E85A                4C77
                FE97                E85B                4CA2
                FE98                E85C                4D13
                FE99                E85D                4D14
                FE9A                E85E                4D15
                FE9B                E85F                4D16
                FE9C                E860                4D17
                FE9D                E861                4D18
                FE9E                E862                4D19
                FE9F                E863                4DAE
                FEA0                E864                9FBB

The following 14 characters are the GB18030-2005 chracters that are still mapped to Unicode PUA, and
I suggest the encoding standard mapping those characters into Unicode non-PUA, cause we have no need
to waiting GB18030 to update it's spec just for those 14 chracters, and we could be sure those 14 chracters's
corresponding Unicode non-PUA characters are decided.

Han Character      GBK              Unicode PUA       Unicode non-PUA
                FE51                E816                20087
                FE52                E817                20089
                FE53                E818                200CC
                FE59                E81E                9FB4
                FE61                E826                9FB5
                FE66                E82B                9FB6
                FE67                E82C                9FB7
                FE6C                E831                215D7
                FE6D                E832                9FB8
                FE76                E83B                2298F
                FE7E                E843                9FB9
                FE90                E854                9FBA
                FE91                E855                241FE
                FEA0                E864                9FBB

And according to these, we can decode all GBK encoding family strings to non-PUA Unicode,
Besides these, we still have the need to convert all the historical Unicode PUA characters
to proper GBK(GB18030) characters.

Activity

  1. vyv03354 commented on Jan 17, 2016

    @vyv03354
    Collaborator

    I disagree. We shouldn't invent yet another new encoding anymore.

  2. annevk commented on Jan 17, 2016

    @annevk
    Member

    I tend to agree with @vyv03354. Since no implementation does this and developers are asked to use utf-8, I don't really see an upside here. This only increases the chance that things break.

  3. lygstate commented on Jan 17, 2016

    @lygstate
    Author

    @vyv03354 @annevk We are not invent new encoding, just getting exist encoding works.

  4. annevk commented on Jan 18, 2016

    @annevk
    Member

    Fair, changing an encoding is not inventing a new one. However, it is not clear why we should change it, since implementations mostly agree here.

  5. lygstate commented on Jan 19, 2016

    @lygstate
    Author

    @annevk @vyv03354 Please consider the following situation, suppose a have text with a Unicode character U20087, when I convert this character to GBK,
    What I should to do? 0xFE51 or other invalid character?
    So we are just refinement the exist convert table to the final state?

  6. vyv03354 commented on Jan 19, 2016

    @vyv03354
    Collaborator

    when I convert this character to GBK,

    We don't convert any plane-2 characters in GBK encoder. It will be changed to a character reference (𠂇).

    Japanese users were suffered from encoding "improvements" of JIS standards and industrial de-facto standards. Even one character change is considered as a new encoding in ISO coded character set standards. Such a change will have more harm than good even if it is out of good will.

  7. lygstate commented on Jan 19, 2016

    @lygstate
    Author

    @vyv03354 That's really different, cause JIS doesn't mapping any characters to PUA Unicode character, that's just because at that time, The Unicode is didn't have enough charset for GBK, but now it's has, that's totally different.

  8. annevk commented on Jan 20, 2016

    @annevk
    Member

    @lygstate as with the other issue, I recommend using utf-8 instead. I agree with @vyv03354 that changing implementations at this point is more likely to lead to breakage than happy users.

  9. Artoria2e5 commented on Sep 5, 2016

    @Artoria2e5

    Will you add something like a line of "note" to the description for gb18030 in the spec mentioning this issue? PUA really brings a lot of issues to users as using its codepoints without a common agreement is like inventing a nationwide Unicode dialect.

    To be frank I would rather leave the dialect pollution in the legacy encoder/decoder bridge than let it spread in the new world, so please consider adding:

    • a flag that instructs the decoder to not emit PUA
    • a flag that instructs the encoder to warn against PUA usage potentially resulting from GB18030-200{0,5} decoding

    and as a basis for these changes,

    • a mapping from "old world" PUAs to "new world" Unicode CJK Extensions.

    See also:

    @lygstate Could you please consider reopening this issue if you find my — um — attempt helpful?

    gbk-gb18030-pua.txt

  10. annevk commented on Sep 6, 2016

    @annevk
    Member

    @Artoria2e5 the "new world" should use utf-8 exclusively.

  11. lygstate commented on Sep 6, 2016

    @lygstate
    Author

    @annevk But we still need a way to migrade from the old world.

  12. Artoria2e5 commented on Sep 6, 2016

    @Artoria2e5

    @annevk It's true that the modern world should use UTF-8 for information exchange, processing and storage. But given that character representations in UTF-8 relies on codepoints assigned in Unicode, it makes sense to use the formal, universal codepoint assignments in this universal encoding.

    As stated previously, by emitting PUA codepoints in the decoder, you are speaking in a Unicode dialect codepoint-wise, resulting in a less interchangeable UTF-8 variant, thus contradicting the point of using UTF-8 everywhere. (The use of PUA here cannot be justified by a lack of definition as these ideographs do have formal assignments.) The encoder part is more about discouraging old PUA usage.

    But we still need a way to migra[t]e from the old world.

    And we need to make sure that the way gives us actual "new world" stuff.


    By the way, there should be 24 PUA codepoints in the 2005 standard instead of 14, according to the L2/06-394 "Update on GB 18030:2005" by Ken Lunde.


    An interesting but sad example of this dialect split can be shown using the character U+20087 (𠂇), assigned to PUA codepoint U+E816 () in the mapping. Search engines like Google won't do normalization on PUA forms where several different sets of agreements exist, and you can see it from the search results.

  13. annevk commented on Sep 6, 2016

    @annevk
    Member

    Given that no browser implements gb18030 like that I don't see why we should change this. We could easily break those relying on these bytes mapping to PUA. I'm also somewhat reluctant to add a note, since as far as I can tell this is just someone's opinion and those maintaining gb18030 have not decided to care.

  14. aphillips commented on Sep 6, 2016

    @aphillips
    Contributor

    The GB18030 mapping is naturally fungible wrt PUA characters, since Unicode continues to encode Chinese code points. I think this should be recognized by Encoding.

    I agree that we should not remove mapping of Unicode PUA -> GB18030 (compatibility). But the problem here is round-tripping of real Unicode code points with GB18030.

    If I have a U+20087, convert it to GB18030, and the later reserialize the GB data as UTF-8, I will get back U+E816 rather than the original (and correct) code point. That's undesirable and a loss of information. The fact that existing implementations haven't caught up with standardization doesn't mean that we shouldn't make this change.

    @annevk Under what circumstances would we change? One of the problems with establishing a standard is that implementations are trying hard to be compliant with it...

  15. 24 remaining items

  16. wswartzendruber commented on Aug 29, 2021

    @wswartzendruber

    Hello. I am an independent individual who is implementing a GB 18030 encoder purely as a hobby (it is quite challenging to do concisely). Was there ever an update on GB 18030-2018?

  17. lygstate commented on Sep 5, 2021

    @lygstate
    Author

    @kenlunde Hi, does the new 2018 standard released?

  18. TimothyGu commented on Sep 14, 2021

    @TimothyGu
    Member

    It appears that it's still under review. See IRGN2496 that was published on 2021-09-09:

    1. Progress of the revision of GB 18030 Information technology -- Chinese coded character set

    GB 18030 Information technology -- Chinese coded character set is one of the most important mandatory national standards of PRC. It has been revised once and the latest edition is GB 18030-2005. The third edition is now under review by the related authority.

    (note, this is the same update as IRGN2453, dated 2021-03-05)

    One thing that could have delayed the publication of the new revision could be related to the new regulations alluded to in IRGN2453:

    To be noticed, according to the Measures for the Administration of Mandatory National Standards issued by the State Administration for Market Regulation of PRC in 2020, there is a big change that in the third edition the full text of GB 18030 should be all mandatory instead of partially mandatory in its previous edition.

  19. TimothyGu commented on Sep 14, 2021

    @TimothyGu
    Member

    @kenlunde just told me that during a meeting yesterday(!!), the delegates from China anticipate the revision to be published next year (2022). Here's some more information:

    Note that Implementation Level 1 is the current status quo for GB 18030 support. Implementation Level 2 requires the following 199 additional ideographs from TGH-2013 (通用规范汉字表):

    All glyphs

    U+9FCD 鿍
    U+9FCE 鿎
    U+9FCF 鿏
    U+20164 𠅤
    U+20676 𠙶
    U+20CD0 𠳐
    U+2139A 𡎚
    U+21413 𡐓
    U+235CB 𣗋
    U+23C97 𣲗
    U+23C98 𣲘
    U+23E23 𣸣
    U+249DB 𤧛
    U+24A7D 𤩽
    U+24AC9 𤫉
    U+25532 𥔲
    U+25562 𥕢
    U+255A8 𥖨
    U+25ED7 𥻗
    U+26221 𦈡
    U+2648D 𦒍
    U+26676 𦙶
    U+2677C 𦝼
    U+26B5C 𦭜
    U+26C21 𦰡
    U+27FF9 𧿹
    U+28408 𨐈
    U+28678 𨙸
    U+28695 𨚕
    U+287E0 𨟠
    U+28B49 𨭉
    U+28C47 𨱇
    U+28C4F 𨱏
    U+28C51 𨱑
    U+28C54 𨱔
    U+28E99 𨺙
    U+29F7E 𩽾
    U+29F83 𩾃
    U+29F8C 𩾌
    U+2A7DD 𪟝
    U+2A8FB 𪣻
    U+2A917 𪤗
    U+2AA30 𪨰
    U+2AA36 𪨶
    U+2AA58 𪩘
    U+2AFA2 𪾢
    U+2B127 𫄧
    U+2B128 𫄨
    U+2B137 𫄷
    U+2B138 𫄸
    U+2B1ED 𫇭
    U+2B300 𫌀
    U+2B363 𫍣
    U+2B36F 𫍯
    U+2B372 𫍲
    U+2B37D 𫍽
    U+2B404 𫐄
    U+2B410 𫐐
    U+2B413 𫐓
    U+2B461 𫑡
    U+2B4E7 𫓧
    U+2B4EF 𫓯
    U+2B4F6 𫓶
    U+2B4F9 𫓹
    U+2B50D 𫔍
    U+2B50E 𫔎
    U+2B536 𫔶
    U+2B5AE 𫖮
    U+2B5AF 𫖯
    U+2B5B3 𫖳
    U+2B5E7 𫗧
    U+2B5F4 𫗴
    U+2B61C 𫘜
    U+2B61D 𫘝
    U+2B626 𫘦
    U+2B627 𫘧
    U+2B628 𫘨
    U+2B62A 𫘪
    U+2B62C 𫘬
    U+2B695 𫚕
    U+2B696 𫚖
    U+2B6AD 𫚭
    U+2B6ED 𫛭
    U+2B7A9 𫞩
    U+2B7C5 𫟅
    U+2B7E6 𫟦
    U+2B7F9 𫟹
    U+2B7FC 𫟼
    U+2B806 𫠆
    U+2B80A 𫠊
    U+2B81C 𫠜
    U+2B8B8 𫢸
    U+2BAC7 𫫇
    U+2BB5F 𫭟
    U+2BB62 𫭢
    U+2BB7C 𫭼
    U+2BB83 𫮃
    U+2BC1B 𫰛
    U+2BD77 𫵷
    U+2BD87 𫶇
    U+2BDF7 𫷷
    U+2BE29 𫸩
    U+2C029 𬀩
    U+2C02A 𬀪
    U+2C0A9 𬂩
    U+2C0CA 𬃊
    U+2C1D5 𬇕
    U+2C1D9 𬇙
    U+2C1F9 𬇹
    U+2C27C 𬉼
    U+2C288 𬊈
    U+2C2A4 𬊤
    U+2C317 𬌗
    U+2C35B 𬍛
    U+2C361 𬍡
    U+2C364 𬍤
    U+2C488 𬒈
    U+2C494 𬒔
    U+2C497 𬒗
    U+2C542 𬕂
    U+2C613 𬘓
    U+2C618 𬘘
    U+2C621 𬘡
    U+2C629 𬘩
    U+2C62B 𬘫
    U+2C62C 𬘬
    U+2C62D 𬘭
    U+2C62F 𬘯
    U+2C642 𬙂
    U+2C64A 𬙊
    U+2C64B 𬙋
    U+2C72C 𬜬
    U+2C72F 𬜯
    U+2C79F 𬞟
    U+2C7C1 𬟁
    U+2C7FD 𬟽
    U+2C8D9 𬣙
    U+2C8DE 𬣞
    U+2C8E1 𬣡
    U+2C8F3 𬣳
    U+2C907 𬤇
    U+2C90A 𬤊
    U+2C91D 𬤝
    U+2CA02 𬨂
    U+2CA0E 𬨎
    U+2CA7D 𬩽
    U+2CAA9 𬪩
    U+2CB29 𬬩
    U+2CB2D 𬬭
    U+2CB2E 𬬮
    U+2CB31 𬬱
    U+2CB38 𬬸
    U+2CB39 𬬹
    U+2CB3B 𬬻
    U+2CB3F 𬬿
    U+2CB41 𬭁
    U+2CB4A 𬭊
    U+2CB4E 𬭎
    U+2CB5A 𬭚
    U+2CB5B 𬭛
    U+2CB64 𬭤
    U+2CB69 𬭩
    U+2CB6C 𬭬
    U+2CB6F 𬭯
    U+2CB73 𬭳
    U+2CB76 𬭶
    U+2CB78 𬭸
    U+2CB7C 𬭼
    U+2CBB1 𬮱
    U+2CBBF 𬮿
    U+2CBC0 𬯀
    U+2CBCE 𬯎
    U+2CC56 𬱖
    U+2CC5F 𬱟
    U+2CCF5 𬳵
    U+2CCF6 𬳶
    U+2CCFD 𬳽
    U+2CCFF 𬳿
    U+2CD02 𬴂
    U+2CD03 𬴃
    U+2CD0A 𬴊
    U+2CD8B 𬶋
    U+2CD8D 𬶍
    U+2CD8F 𬶏
    U+2CD90 𬶐
    U+2CD9F 𬶟
    U+2CDA0 𬶠
    U+2CDA8 𬶨
    U+2CDAD 𬶭
    U+2CDAE 𬶮
    U+2CDD5 𬷕
    U+2CE18 𬸘
    U+2CE1A 𬸚
    U+2CE23 𬸣
    U+2CE26 𬸦
    U+2CE2A 𬸪
    U+2CE7C 𬹼
    U+2CE88 𬺈
    U+2CE93 𬺓

    The PingFang, Source Han, and Noto CJK fonts support Implementation Level 2.

  20. xfq commented on Aug 17, 2022

    @xfq

    The GB 18030-2022 Standard has been published in July 2022. The new version includes 196 Chinese characters that are in the Table of General Standard Chinese Characters but not in GB 18030-2005, includes 17,000+ other new Chinese characters, and has established three implementation levels.

    This standard is mandatory in Mainland China. All software supporting Chinese information processing and exchange must support level 1, some software such as operating systems, databases, and middleware must support level 2, and systems for public services must support level 3. (The higher the level, the more Chinese characters are included.)

  21. added
    i18n-trackerGroup bringing to attention of Internationalization, or tracked by i18n but not needing response.
    i18n-clreqNotifies Chinese script experts of relevant issues
    on Aug 17, 2022
  22. hsivonen commented on Aug 17, 2022

    @hsivonen
    Member

    The GB 18030-2022 Standard has been published in July 2022.

    More information in English

    This standard is mandatory in Mainland China.

    Support for the mandatory characters can be achieved vie UTF-8, which the Encoding Standard already supports (and, evidently, there are now UTF-8-only software and formats).

  23. vyv03354 commented on Aug 17, 2022

    @vyv03354
    Collaborator

    Do we implement 18 code point swaps, after all?

  24. annevk commented on Oct 27, 2022

    @annevk
    Member

    https://unicode-org.atlassian.net/browse/ICU-22098 might have implications for what some implementations do, I presume. That raises the importance of resolving #57 somewhat.

  25. hfhchan commented on Oct 28, 2022

    @hfhchan

    GB18030-2022 will take effect on 1 Aug 2023. Compliance criteria include, at a minimum, not emitting PUA characters for the 24 characters for input methods, and not using the 24 PUA codepoints for fonts.

    However, most existing products sold on the Chinese market fail these tests and those old versions will still be expected to be used, even though they will no longer be allowed to be sold after the effective date. Also there's existing UTF-8 content which are using those PUA codepoints.

    To be backwards compatible with older products based on the GB18030-2005 standards, both the PUA and the non-PUA codepoints should map to the correct GB18030-2022 2-byte sequences.

    Whether or not the 4-byte sequences should map to the non-PUA codepoints is less of an issue -- it is not expected that there be data in GB18030 that are stored in the 4-byte form. However, if keeping the double mapping to U+3000 is deemed web compatible, then keeping the 4-byte sequences mapped to the non-PUA codepoints should also be web compatible in the same manner.

  26. annevk commented on Sep 17, 2024

    @annevk
    Member

    I created #336 which I hope addresses this. Review most welcome!

  27. added a commit that references this issue on Sep 18, 2024
    1d519bf
  28. added a commit that references this issue on Oct 4, 2024
    2c3853e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    i18n-clreqNotifies Chinese script experts of relevant issuesi18n-trackerGroup bringing to attention of Internationalization, or tracked by i18n but not needing response.normative

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions