-function decode_hex(str) {
- n = 0;
- len = length(str);
- for (i = 1; i <= len; i++)
- {
- c = substr(str, i, 1);
- if (c >= "0" && c <= "9")
- n = n * 16 + (c - "0");
- else
- n = n * 16 + tohex[c];
+function write_entry (unicode) {
+ if (state == 1) {
+ if ($2 == JISX0208_FROM1 || $2 == JISX0208_FROM2)
+ state = 2;
+ } else if (state == 3) {
+ if ($2 == JISX0212_FROM)
+ state = 4;
+ }
+ if (state == 2) {
+ jis = $2
+ gsub("/x", "", jis);
+ printf "\n (#x%s . #x%s)", jis, unicode;
+ if ($2 == JISX0208_TO1)
+ state = 1;
+ } else if (state == 4) {
+ jis = substr($2, 5, 8);
+ gsub("/x", "", jis);
+ printf "\n (#x%s #x%s)", jis, unicode;