20 function decode_hex
(str
) {
23 for (i =
1; i
<= len
; i
++)
25 c =
substr (str
, i
, 1);
26 if (c
>=
"0" && c
<=
"9")
27 n = n
* 16 + (c
- "0");
29 n = n
* 16 + tohex
[c
];
34 function gb_to_index
(gb
) {
37 idx =
(((b0
- 129)) * 191 + b1
- 64);
43 function index_to_gb
(idx
) {
44 b0 = int
(idx
/ 191) + 129;
45 b1 =
(idx %
191) + 64;
48 return (b0
* 256 + b1
);
57 gb = gb_to_index
(decode_hex
(substr($
1, 3, 4)));
58 unicode = decode_hex
(substr($
2, 3, 4));
59 if ((gb == to_gb
+ 1) && (unicode == to_unicode
+ 1))
67 printf "0x%04X 0x%04X\n", index_to_gb
(from_gb
), from_unicode
;
68 else if (from_gb
< to_gb
)
69 printf "0x%04X-0x%04X 0x%04X\n",
70 index_to_gb
(from_gb
), index_to_gb
(to_gb
), from_unicode
;
72 from_unicode = to_unicode = unicode
;
78 printf "0x%04X-0x%04X 0x%04X\n",
79 index_to_gb
(from_gb
), index_to_gb
(to_gb
), from_unicode
;
82 # arch-tag: d7dbad89-a512-41a4-8ee0-ba1a4505b8c1