Difference between revisions of "Template:GB18030/main"

From blackwiki
Jump to navigation Jump to search
imported>HarJIT
imported>HarJIT
Line 1: Line 1:
 
{{#switch:{{{1|128169}}}
 
{{#switch:{{{1|128169}}}
|165={{#if:{{yesno|{{{gb1988|}}}}}|24|81 30 84 36}}
+
|165={{#if:{{yesno|{{{gb1988|}}}}}|24|81 30 84 36}} <!-- 81308436 is explicitly U+00A5 in whichever case -->
 
|7743={{#ifeq:{{{edition|}}}|2000|81 35 F4 37|A8 BC}}
 
|7743={{#ifeq:{{{edition|}}}|2000|81 35 F4 37|A8 BC}}
 
|59335={{#ifeq:{{{edition|}}}|2000|A8 BC|81 35 F4 37}}
 
|59335={{#ifeq:{{{edition|}}}|2000|A8 BC|81 35 F4 37}}

Revision as of 19:15, 17 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).