16 function decode_hex
(str
) {
19 for (i =
1; i
<= len
; i
++)
21 c =
substr (str
, i
, 1);
22 if (c
>=
"0" && c
<=
"9")
23 n = n
* 16 + (c
- "0");
25 n = n
* 16 + tohex
[c
];
30 function gb_to_index
(gb
) {
33 idx =
(((b0
- 129)) * 191 + b1
- 64);
39 function index_to_gb
(idx
) {
42 b2 =
(idx %
126) + 129;
45 b0 = int
(idx
/ 10) + 129;
46 return sprintf("%02X%02X%02X%02X", b0
, b1
, b2
, b3
);
55 gb_from = gb_to_index
(decode_hex
(substr($
1, 3, 4)));
56 gb_to = gb_to_index
(decode_hex
(substr($
1, 10, 4)));
57 unicode = decode_hex
(substr($
2, 3, 4));
58 while (gb_from
<= gb_to
)
67 gb = decode_hex
(substr($
1, 3, 4));
68 unicode = decode_hex
(substr($
2, 3, 4));
77 for (i =
128; i
<=
65536; i
++)
81 if (i
< 55296 || i
>=
57344)
91 else if (from_gb
>=
0)
93 if (from_gb
+ 1 == to_gb
)
94 printf "0x%s\t\t0x%04X\n",
95 index_to_gb
(from_gb
), from_i
;
97 printf "0x%s-0x%s\t0x%04X\n",
98 index_to_gb
(from_gb
), index_to_gb
(to_gb
- 1), from_i
;
104 # arch-tag: 8e5a22ae-610e-411f-ae17-d6e528b30d71