Difference between revisions of "Template:GB18030/main"
Jump to navigation
Jump to search
imported>HarJIT |
imported>HarJIT |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{#switch:{{{1|128169}}} | {{#switch:{{{1|128169}}} | ||
+ | <!-- | ||
+ | |||
+ | 0x81308436 is explicitly U+00A5 in whichever case. So if we're mapping 0x24 to U+00A5 | ||
+ | (per the glyph), that would mean that U+0024 has no mapping. Nobody does this in | ||
+ | practice (it would not be a UTF, and rather seriously lack an ASCII U+0024). --> | ||
+ | |36={{#if:{{yesno|{{{gb1988|}}}}}||24}} | ||
|165={{#if:{{yesno|{{{gb1988|}}}}}|24|81 30 84 36}} | |165={{#if:{{yesno|{{{gb1988|}}}}}|24|81 30 84 36}} | ||
+ | <!-- | ||
+ | |||
+ | The 2005 standard encoding swap of ḿ. The ./BMP template doesn't address this, but this | ||
+ | is moot since we're handling it here. --> | ||
|7743={{#ifeq:{{{edition|}}}|2000|81 35 F4 37|A8 BC}} | |7743={{#ifeq:{{{edition|}}}|2000|81 35 F4 37|A8 BC}} | ||
− | |59335={{# | + | |59335={{#switch:{{{edition|}}}|2000=A8 BC|newucs= |#default=81 35 F4 37}} |
<!-- | <!-- | ||
− | + | 0xA1A1 is still preferred for U+3000, so WHATWG treatment of 0xA3A0 just means that | |
− | doesn't round trip as far as we (coding UCS scalars as GB18030) are concerned. --> | + | PUA U+E5E5 doesn't round trip as far as we (coding UCS scalars as GB18030) are concerned. --> |
|58853={{#ifeq:{{{edition|}}}|web||A3 A0}} | |58853={{#ifeq:{{{edition|}}}|web||A3 A0}} | ||
<!-- | <!-- | ||
So far as I know, any implementation that does this just doesn't round-trip the PUA codes? | So far as I know, any implementation that does this just doesn't round-trip the PUA codes? | ||
− | The next edition of GB 18030 might fully swap them, of course ( | + | The next edition of GB 18030 might fully swap them, of course (like the 2005 edition and ḿ), |
but it could also e.g. move the PUA codes to the sizeable reserved four-byte regions after | but it could also e.g. move the PUA codes to the sizeable reserved four-byte regions after | ||
− | the BMP or after the SPUAB. So I'm merely clearing the encodings of | + | the BMP or after the SPUAB. So I'm merely clearing the encodings of those PUA codes in |
− | to edition=newucs for the time being. --> | + | response to edition=newucs for the time being. --> |
|40884={{#ifeq:{{{edition|}}}|newucs|FE 59|82 35 90 37}} | |40884={{#ifeq:{{{edition|}}}|newucs|FE 59|82 35 90 37}} | ||
|40885={{#ifeq:{{{edition|}}}|newucs|FE 61|82 35 90 38}} | |40885={{#ifeq:{{{edition|}}}|newucs|FE 61|82 35 90 38}} | ||
Line 23: | Line 33: | ||
|40890={{#ifeq:{{{edition|}}}|newucs|FE 90|82 35 91 33}} | |40890={{#ifeq:{{{edition|}}}|newucs|FE 90|82 35 91 33}} | ||
|40891={{#ifeq:{{{edition|}}}|newucs|FE A0|82 35 91 34}} | |40891={{#ifeq:{{{edition|}}}|newucs|FE A0|82 35 91 34}} | ||
− | |59277={{#ifeq:{{{edition|}}}| | + | |59277={{#ifeq:{{{edition|}}}|newucs||A6 D9}} |
− | |59278={{#ifeq:{{{edition|}}}| | + | |59278={{#ifeq:{{{edition|}}}|newucs||A6 DA}} |
− | |59279={{#ifeq:{{{edition|}}}| | + | |59279={{#ifeq:{{{edition|}}}|newucs||A6 DB}} |
− | |59280={{#ifeq:{{{edition|}}}| | + | |59280={{#ifeq:{{{edition|}}}|newucs||A6 DC}} |
− | |59281={{#ifeq:{{{edition|}}}| | + | |59281={{#ifeq:{{{edition|}}}|newucs||A6 DD}} |
− | |59282={{#ifeq:{{{edition|}}}| | + | |59282={{#ifeq:{{{edition|}}}|newucs||A6 DE}} |
− | |59283={{#ifeq:{{{edition|}}}| | + | |59283={{#ifeq:{{{edition|}}}|newucs||A6 DF}} |
− | |59284={{#ifeq:{{{edition|}}}| | + | |59284={{#ifeq:{{{edition|}}}|newucs||A6 EC}} |
− | |59285={{#ifeq:{{{edition|}}}| | + | |59285={{#ifeq:{{{edition|}}}|newucs||A6 ED}} |
− | |59286={{#ifeq:{{{edition|}}}| | + | |59286={{#ifeq:{{{edition|}}}|newucs||A6 F3}} |
− | |59414={{#ifeq:{{{edition|}}}| | + | |59414={{#ifeq:{{{edition|}}}|newucs||FE 51}} |
− | |59415={{#ifeq:{{{edition|}}}| | + | |59415={{#ifeq:{{{edition|}}}|newucs||FE 52}} |
− | |59416={{#ifeq:{{{edition|}}}| | + | |59416={{#ifeq:{{{edition|}}}|newucs||FE 53}} |
− | |59422={{#ifeq:{{{edition|}}}| | + | |59422={{#ifeq:{{{edition|}}}|newucs||FE 59}} |
− | |59430={{#ifeq:{{{edition|}}}| | + | |59430={{#ifeq:{{{edition|}}}|newucs||FE 61}} |
− | |59435={{#ifeq:{{{edition|}}}| | + | |59435={{#ifeq:{{{edition|}}}|newucs||FE 66}} |
− | |59436={{#ifeq:{{{edition|}}}| | + | |59436={{#ifeq:{{{edition|}}}|newucs||FE 67}} |
− | |59441={{#ifeq:{{{edition|}}}| | + | |59441={{#ifeq:{{{edition|}}}|newucs||FE 6C}} |
− | |59442={{#ifeq:{{{edition|}}}| | + | |59442={{#ifeq:{{{edition|}}}|newucs||FE 6D}} |
− | |59451={{#ifeq:{{{edition|}}}| | + | |59451={{#ifeq:{{{edition|}}}|newucs||FE 76}} |
− | |59459={{#ifeq:{{{edition|}}}| | + | |59459={{#ifeq:{{{edition|}}}|newucs||FE 7E}} |
− | |59476={{#ifeq:{{{edition|}}}| | + | |59476={{#ifeq:{{{edition|}}}|newucs||FE 90}} |
− | |59477={{#ifeq:{{{edition|}}}| | + | |59477={{#ifeq:{{{edition|}}}|newucs||FE 91}} |
− | |59492={{#ifeq:{{{edition|}}}| | + | |59492={{#ifeq:{{{edition|}}}|newucs||FE A0}} |
|65040={{#ifeq:{{{edition|}}}|newucs|A6 D9|84 31 82 36}} | |65040={{#ifeq:{{{edition|}}}|newucs|A6 D9|84 31 82 36}} | ||
|65041={{#ifeq:{{{edition|}}}|newucs|A6 DB|84 31 82 37}} | |65041={{#ifeq:{{{edition|}}}|newucs|A6 DB|84 31 82 37}} | ||
Line 66: | Line 76: | ||
-->|{{hexadecimal|{{{1|128169}}}|no}}<!-- | -->|{{hexadecimal|{{{1|128169}}}|no}}<!-- | ||
-->|{{#ifexpr:{{{1|128169}}} > 65535<!-- | -->|{{#ifexpr:{{{1|128169}}} > 65535<!-- | ||
− | -->|{{ | + | -->|{{GB18030/astral|{{{1|128169}}} }}<!-- |
− | -->|{{ | + | -->|{{GB18030/BMP|{{{1|128169}}} }}<!-- |
-->}}<!-- | -->}}<!-- | ||
-->}} | -->}} | ||
}}<noinclude>{{documentation}}</noinclude> | }}<noinclude>{{documentation}}</noinclude> |
Latest revision as of 12:44, 18 August 2020
94 39 DA 33
Contains the overriding logic of {{GB18030}}
. Defines mappings for problem codes (those which differ between editions, or between implementations, or four-byte codes out of order resulting from this) itself. Handles ASCII characters itself. For other characters, invokes Template:GB18030/BMP or Template:GB18030/astral.
Usage
Takes one positional parameter: a Unicode code point in decimal. Outputs a GB 18030 byte sequence in hexadecimal, with bytes delimited by spaces.
Optional named parameters include gb1988
(a boolean controlling if ¥ is mapped to 0x24—if in doubt, leave this off) and edition
(2000
, 2005
, web
or newucs
—defaulting to 2005
).
The above documentation is transcluded from Template:GB18030/main/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |