summaryrefslogtreecommitdiff
path: root/src/locale
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-07-12 00:31:39 -0400
committerRich Felker <dalias@aerifal.cx>2011-07-12 00:31:39 -0400
commit594b16e00491a8d5e18be7669ae1c2d4219e52c7 (patch)
tree9bad3da61cad900cddf79296474d60b609f64c5a /src/locale
parent6b1d3817cfb5d2b9d3eb66667fba2bc8e87180ef (diff)
downloadmusl-594b16e00491a8d5e18be7669ae1c2d4219e52c7.tar.gz
simplify iconv and support more legacy codepages
Diffstat (limited to 'src/locale')
-rw-r--r--src/locale/codepages.h238
-rw-r--r--src/locale/iconv.c406
-rw-r--r--src/locale/legacychars.h39
3 files changed, 331 insertions, 352 deletions
diff --git a/src/locale/codepages.h b/src/locale/codepages.h
new file mode 100644
index 00000000..35acd5a3
--- /dev/null
+++ b/src/locale/codepages.h
@@ -0,0 +1,238 @@
+"iso88591\0"
+"latin1\0"
+"\0\200"
+
+"iso88592\0"
+"\0\40"
+"\0\124\0\211\22\0\40\1\6\0\0\230\101\206\32\177\0\60\110\40\0\130\40\311\22"
+"\0\44\21\306\43\0\234\121\306\32\200\120\102\210\40\132\0\0\300\4\0\20\161\1\0"
+"\35\0\160\2\0\51\0\0\300\7\41\60\1\5\0\0\130\1\0\0\136\320\1\200\35"
+"\0\0\200\6\0\133\0\0\0\5\0\24\201\1\0\36\0\200\2\0\52\0\0\0\10\42\64\21\5\0"
+"\0\134\1\0\0\137\324\1\300\35\0\0\220\106\44"
+
+"iso88593\0"
+"\0\40"
+"\0\324\0\11\0\0\4\60\3\0\0\364\100\106\13\77\0\20\100\40\0\330\0\0\0"
+"\0\0\100\3\0\0\370\120\206\13\100\0\20\200\40\0\0\0\100\0\0\154\220\1\0"
+"\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\274\0\0\0\53\0\0\0\0\0\310\41\6\0\0\0\0\100\0"
+"\0\160\240\1\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\300\0\0\0\54\0\0\0\0"
+"\0\314\61\106\44"
+
+"iso88594\0"
+"\0\40"
+"\0\124\60\4\27\0\334\140\4\0\0\230\61\102\14\154\0\60\10\0\0\130\40\111\27"
+"\0\340\160\304\43\0\234\101\202\14\155\110\101\310\24\21\0\0\0\0\0\0\0\300\16"
+"\35\0\160\2\0\45\0\0\100\16\41\70\101\105\20\0\0\0\0\0\0\340\1\0\0\0\270\1\7\0"
+"\22\0\0\0\0\0\0\0\0\17\36\0\200\2\0\46\0\0\200\16\42\74\121\205\20\0\0\0\0\0"
+"\0\344\1\0\0\0\274\21\107\44"
+
+"iso88595\0"
+"\0\40"
+"\0\210\63\16\71\345\230\163\16\72\351\250\263\16\73\355\0\340\316\73"
+"\360\304\43\317\74\364\324\143\317\75\370\344\243\317\76\374\364\343\317\77"
+"\0\5\44\320\100\4\25\144\320\101\10\45\244\320\102\14\65\344\320\103"
+"\20\105\44\321\104\24\125\144\321\105\30\145\244\321\106\34\165\344\321\107"
+"\40\205\44\322\110\44\225\144\322\111\50\245\244\322\112\54\265\344\322\113"
+"\65\302\24\223\114\63\321\124\223\115\67\341\224\223\116\73\15\300\123\117"
+
+"iso88596\0"
+"\0\40"
+"\0\4\20\100\0\0\4\20\100\0\1\4\20\100\0\163\1\20\100\0\1\4\20\100\0"
+"\1\4\20\100\0\1\4\20\0\135\1\4\20\100\135\1\330\165\27\136\171\351\265\27\137"
+"\175\371\365\27\140\201\11\66\30\141\205\31\166\30\142\211\51\266\30\143"
+"\215\71\366\130\0\1\4\20\100\0\220\105\46\331\144\224\125\146\331\145"
+"\230\145\246\331\146\234\165\346\331\147\240\205\46\132\0\1\4\20\100\0"
+"\1\4\20\100\0\1\4\20\100\0"
+
+"iso88597\0"
+"\0\40"
+"\0\220\130\42\0\63\322\10\0\0\0\0\240\11\0\0\0\20\200\210\0\0\0\0\0"
+"\233\160\322\11\0\236\174\2\12\0\241\0\40\312\50\244\224\142\312\51"
+"\250\244\242\312\52\254\264\342\312\53\260\304\42\313\54\264\324\22\200\55"
+"\267\340\222\213\56\273\360\322\213\57\277\0\23\214\60\303\20\123\214\61"
+"\307\40\223\214\62\313\60\323\214\63\317\100\23\215\64\323\120\123\215\65"
+"\327\140\223\215\66\333\160\323\215\67\337\200\23\116\0"
+
+"iso88598\0"
+"\0\40"
+"\0\4\0\0\0\0\0\0\0\0\0\0\300\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\360\0\0"
+"\0\0\0\100\0\1\4\20\100\0\1\4\20\100\0\1\4\20\100\0\1\4\20\100\0\1\4\20\100\0"
+"\1\4\20\100\0\1\4\20\100\0\1\4\20\300\210\123\121\125\225\125"
+"\127\141\225\225\126\133\161\325\225\127\137\201\25\226\130"
+"\143\221\125\226\131\147\241\225\226\132\153\261\325\126\0\1\170\370\141\0"
+
+"iso88599\0"
+"\0\120"
+"\55\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\364\100\6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+"\0\0\0\0\0\56\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\370\120\6\0"
+
+"iso885910\0"
+"\0\40"
+"\0\124\60\102\14\71\334\20\4\0\106\204\140\6\33\203\0\0\207\24"
+"\0\130\100\202\14\72\340\40\4\0\107\210\160\106\33\204\210\30\307\24"
+"\21\0\0\0\0\0\0\0\300\16\35\0\160\2\0\45\0\0\0\0\0\70\101\5\0\0\0\0\200\33"
+"\0\340\1\0\0\0\0\0\0\0\22\0\0\0\0\0\0\0\0\17\36\0\200\2\0\46\0\0\0\0"
+"\0\74\121\5\0\0\0\0\300\33\0\344\1\0\0\0\0\0\300\20"
+
+"iso885911\0"
+"tis620\0"
+"\0\40"
+"\0\274\6\133\154\262\315\106\133\155\266\335\206\133\156\272\355\306\133\157"
+"\276\375\6\134\160\302\15\107\134\161\306\35\207\134\162\312\55\307\134\163"
+"\316\75\7\135\164\322\115\107\135\165\326\135\207\135\166\332\155\307\135\167"
+"\336\175\7\136\170\342\215\107\136\171\346\235\207\136\0\1\4\20\100\172"
+"\352\255\307\136\173\356\275\7\137\174\362\315\107\137\175\366\335\207\137\176"
+"\372\355\307\137\177\376\375\7\140\200\2\16\110\140\201\1\4\20\100\0"
+
+"iso885913\0"
+"\0\40"
+"\0\240\10\0\0\0\244\10\0\0\15\0\300\5\0\0\0\0\300\2\0\0\0\0\0\47\2\0\0\0"
+"\20\0\320\5\0\0\0\0\200\3\25\354\20\301\5\0\0\160\302\10\35\0\360\107\11"
+"\61\4\221\203\21\146\60\341\4\0\124\0\0\0\0\170\50\1\6\34\0\4\62\10\0"
+"\26\360\40\1\6\0\0\200\2\11\36\0\0\210\11\62\10\241\303\21\147\64\361\4\0"
+"\125\0\0\0\0\171\54\21\106\34\0\10\102\110\211"
+
+"iso885914\0"
+"\0\40"
+"\0\30\170\40\0\33\160\200\40\0\24\2\140\141\202\32\2\0\200\37\12\56\370\2\14"
+"\14\66\10\200\203\25\76\170\41\204\33\142\230\141\204\0\0\0\0\0\0\0\0\0\0"
+"\0\0\0\0\0\0\0\0\0\0\172\0\0\0\0\0\0\0\200\204\0\0\0\0\0\0\0\300\7\0\0\0\0\0\0"
+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\173\0\0\0\0\0\0\0\300\204\0\0\0\0\0\0\0\320\7\0"
+
+"iso885915\0"
+"latin9\0"
+"\0\44"
+"\63\2\140\6\0\147\0\0\0\0\0\0\0\0\0\0\0\0\0\0\203\0\0\0\0\204\0\0\0\0"
+"\130\144\341\7\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+
+"iso885916\0"
+"\0\40"
+"\0\124\140\201\22\63\246\150\6\0\147\0\240\10\0\177\0\0\110\40\0\0\320\301\22"
+"\203\240\10\0\0\204\170\260\10\0\130\144\341\207\40\0\0\0\300\4\0\134\0\0\0"
+"\0\0\0\0\0\0\0\0\0\0\41\60\1\0\0\0\130\1\0\30\166\0\0\0\0\0\234\300\10\0"
+"\0\0\0\0\5\0\140\0\0\0\0\0\0\0\0\0\0\0\0\0\42\64\1\0\0\0\134\1\100\30"
+"\167\0\0\0\0\0\240\320\10\0"
+
+"cp1250\0"
+"windows1250\0"
+"\0\0"
+"\63\6\140\142\0\51\266\250\342\212\1\270\150\306\213\140\250\61\310\37"
+"\1\220\130\342\211\50\262\10\142\210\1\330\170\6\214\141\254\101\10\40"
+"\0\74\2\211\22\0\124\0\0\0\0\0\100\6\0\0\0\0\100\40\0\0\40\311\22\0\0\0\0\0"
+"\0\130\120\6\0\110\120\222\204\40\132\0\0\300\4\0\20\161\1\0\35\0\160\2\0"
+"\51\0\0\300\7\41\60\1\5\0\0\130\1\0\0\136\320\1\200\35\0\0\200\6\0\133\0\0\0\5"
+"\0\24\201\1\0\36\0\200\2\0\52\0\0\0\10\42\64\21\5\0\0\134\1\0\0"
+"\137\324\1\300\35\0\0\220\106\44"
+
+"cp1251\0"
+"windows1251\0"
+"\0\0"
+"\343\220\143\242\114\51\266\250\342\212\63\272\250\316\213\353\264\303\316\73"
+"\61\221\130\342\211\50\262\10\142\210\1\330\210\23\214\71\355\244\123\117"
+"\0\270\303\123\72\0\370\4\0\0\342\0\120\16\0\0\0\0\0\72\0\0\160\116\115"
+"\77\1\0\0\0\60\325\70\23\0\67\231\103\223\115\360\304\43\317\74"
+"\364\324\143\317\75\370\344\243\317\76\374\364\343\317\77\0\5\44\320\100"
+"\4\25\144\320\101\10\45\244\320\102\14\65\344\320\103\20\105\44\321\104"
+"\24\125\144\321\105\30\145\244\321\106\34\165\344\321\107\40\205\44\322\110"
+"\44\225\144\322\111\50\245\244\322\112\54\265\344\322\113"
+
+"cp1252\0"
+"windows1252\0"
+"\0\0"
+"\63\6\140\142\41\51\266\250\342\212\216\270\150\306\213\130\4\60\110\0"
+"\1\220\130\342\211\50\262\10\142\210\223\330\170\6\214\131\4\100\210\37"
+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+
+"cp1253\0"
+"windows1253\0"
+"\0\0"
+"\63\6\140\142\41\51\266\250\342\212\1\270\30\300\213\1\4\20\100\0"
+"\1\220\130\342\211\50\262\10\142\210\1\330\30\0\214\1\4\20\100\0"
+"\0\160\322\11\0\0\0\0\0\0\0\0\20\0\0\0\0\0\200\210\0\0\0\0\0\233\0\0\0\0"
+"\236\174\2\12\0\241\0\40\312\50\244\224\142\312\51\250\244\242\312\52"
+"\254\264\342\312\53\260\304\42\313\54\264\324\22\200\55\267\340\222\213\56"
+"\273\360\322\213\57\277\0\23\214\60\303\20\123\214\61\307\40\223\214\62"
+"\313\60\323\214\63\317\100\23\215\64\323\120\123\215\65\327\140\223\215\66"
+"\333\160\323\215\67\337\200\23\116\0"
+
+"cp1254\0"
+"windows1254\0"
+"\0\0"
+"\63\6\140\142\41\51\266\250\342\212\216\270\150\306\213\130\4\20\100\0"
+"\1\220\130\342\211\50\262\10\142\210\223\330\170\6\214\131\4\20\200\37"
+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\55\0\0\0\0\0\0\0\0\0"
+"\0\0\0\0\0\0\364\100\6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\56\0\0\0\0"
+"\0\0\0\0\0\0\0\0\0\0\0\370\120\6\0"
+
+"cp1255\0"
+"windows1255\0"
+"\0\0"
+"\63\6\140\142\41\51\266\250\342\212\216\270\30\300\213\1\4\20\100\0"
+"\1\220\130\342\211\50\262\10\142\210\223\330\30\0\214\1\4\20\100\0\0\0\0\0\0"
+"\61\2\0\0\0\0\0\300\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\360\0\0\0\0\0\0\0"
+"\100\5\45\324\120\104\25\145\324\121\110\45\25\200\122\113\61\325\224\123"
+"\117\101\25\225\124\156\275\5\127\134\162\5\20\100\0\1\4\20\100\0"
+"\123\121\125\225\125\127\141\225\225\126\133\161\325\225\127"
+"\137\201\25\226\130\143\221\125\226\131\147\241\225\226\132\153\261\325\126\0"
+"\1\170\370\141\0"
+
+"cp1256\0"
+"windows1256\0"
+"\0\0"
+"\63\222\146\142\41\51\266\250\342\212\216\270\70\332\213\130\224\206\232\151"
+"\252\221\130\342\211\50\262\10\142\210\251\331\170\32\214\131\160\330\341\152"
+"\0\314\5\0\0\0\0\0\0\0\0\0\300\32\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\100\27\0"
+"\0\0\0\100\135\255\331\165\27\136\171\351\265\27\137\175\371\365\27\140"
+"\201\11\66\30\141\205\31\166\30\142\211\51\266\30\0\214\65\346\330\143"
+"\220\105\46\331\144\0\120\6\100\145\226\135\206\31\0\0\0\0\0\0\231\151\6\0\0"
+"\233\161\326\231\147\0\174\6\32\0\241\1\40\32\0\0\170\370\241\153"
+
+"cp1257\0"
+"windows1257\0"
+"\0\0"
+"\63\6\140\142\0\51\266\250\342\212\1\270\30\300\213\1\20\360\210\2"
+"\1\220\130\342\211\50\262\10\142\210\1\330\30\0\214\1\30\40\111\0\0\4\0\0\0"
+"\0\4\0\0\0\15\0\300\5\0\0\0\0\300\2\0\0\0\0\0\0\0\0\0\0\20\0\320\5\0"
+"\0\0\0\200\3\25\354\20\301\5\0\0\160\302\10\35\0\360\107\11\61\4\221\203\21"
+"\146\60\341\4\0\124\0\0\0\0\170\50\1\6\34\0\4\62\10\0\26\360\40\1\6"
+"\0\0\200\2\11\36\0\0\210\11\62\10\241\303\21\147\64\361\4\0\125\0\0\0\0"
+"\171\54\21\106\34\0\10\102\110\44"
+
+"cp1258\0"
+"windows1258\0"
+"\0\0"
+"\63\6\140\142\41\51\266\250\342\212\216\270\30\300\213\130\4\20\100\0"
+"\1\220\130\342\211\50\262\10\142\210\223\330\30\0\214\131\4\20\200\37"
+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+"\0\0\0\0\0\0\0\0\300\4\0\0\0\0\0\0\0\0\0\0\225\0\0\0\0\41\0\200\11\0"
+"\0\30\2\0\0\0\0\0\0\0\0\40\162\11\0\0\0\0\0\5\0\0\0\0\0\0\0\0\0\0\226\0\0\0\0"
+"\42\0\220\11\0\0\34\2\0\0\0\0\0\0\0\0\44\42\43\0"
+
+"koi8r\0"
+"\0\0"
+"\76\376\10\144\220\102\16\111\144\221\106\36\211\244\231\147\242\231\246\232"
+"\153\262\331\46\217\156\336\210\143\216\72\356\50\100\217\7\40\220\300\3"
+"\111\52\271\44\114\114\66\351\344\223\120\106\51\345\224\124\126\151\345\225"
+"\130\146\251\245\70\133\162\331\245\227\137\202\31\246\230\143\222\131\146\1"
+"\56\101\24\221\111\24\125\104\322\104\45\141\224\221\106\33\161\324\221\107"
+"\37\275\4\122\110\42\215\144\221\104\54\255\164\21\112\55\245\164\222\112"
+"\16\301\23\217\101\364\324\103\320\74\5\341\223\217\76\373\360\323\217\77"
+"\377\74\4\120\100\2\15\144\217\74\14\55\164\17\102\15\45\164\220\102"
+
+"koi8u\0"
+"\0\0"
+"\76\376\10\144\220\102\16\111\144\221\106\36\211\244\231\147\242\231\246\232"
+"\153\262\331\46\217\156\336\210\143\216\72\356\50\100\217\7\40\220\300\3"
+"\111\52\271\44\114\63\65\131\223\115\120\106\51\345\224\124\376\144\345\225"
+"\130\146\251\245\70\345\160\171\16\72\137\202\31\246\230\143\372\124\146\1"
+"\56\101\24\221\111\24\125\104\322\104\45\141\224\221\106\33\161\324\221\107"
+"\37\275\4\122\110\42\215\144\221\104\54\255\164\21\112\55\245\164\222\112"
+"\16\301\23\217\101\364\324\103\320\74\5\341\223\217\76\373\360\323\217\77"
+"\377\74\4\120\100\2\15\144\217\74\14\55\164\17\102\15\45\164\220\102"
+
diff --git a/src/locale/iconv.c b/src/locale/iconv.c
index 4ef1477f..4498e40e 100644
--- a/src/locale/iconv.c
+++ b/src/locale/iconv.c
@@ -6,25 +6,15 @@
#include <limits.h>
#include <stdint.h>
-#define UTF_32BE 000
-#define UTF_16LE 001
-#define UTF_16BE 002
-#define UTF_32LE 003
-#define UCS2BE 004
-#define UCS2LE 005
-#define WCHAR_T 007
-
-#define US_ASCII 021
-#define UTF_8 022
-#define LATIN_9 024
-#define TIS_620 025
-#define JIS_0201 026
-
-#define EUC 031
-#define EUC_TW 032
-#define SHIFT_JIS 033
-#define BIG5 034
-#define GBK 035
+#define UTF_32BE 0300
+#define UTF_16LE 0301
+#define UTF_16BE 0302
+#define UTF_32LE 0303
+#define UCS2BE 0304
+#define UCS2LE 0305
+#define US_ASCII 0306
+#define WCHAR_T 0307
+#define UTF_8 0310
/* FIXME: these are not implemented yet
* EUC: A1-FE A1-FE
@@ -34,254 +24,25 @@
/* Definitions of charmaps. Each charmap consists of:
* 1. Empty-string-terminated list of null-terminated aliases.
- * 2. Special type code or bits per character.
- * 3. Number of elided entries (128 for specials).
- * 4. Character table (size determined by fields 2 and 3). */
+ * 2. Special type code or number of elided entries.
+ * 3. Character table (size determined by field 2). */
static const unsigned char charmaps[] =
-"utf8\0\0\022\x80"
-"wchart\0\0\007\x80"
-
-"ucs2\0ucs2be\0\0\004\x80"
-"ucs2le\0\0\005\x80"
-
-"utf16\0utf16be\0\0\002\x80"
-"utf16le\0\0\001\x80"
-
-"ucs4\0ucs4be\0utf32\0utf32be\0\0\000\x80"
-"ucs4le\0utf32le\0\0\003\x80"
-
-"ascii\0iso646\0usascii\0\0\021\x80"
-"latin1\0iso88591\0\0\x09\x80"
-"latin9\0iso885915\0\0\024\x80"
-"tis620\0iso885911\0\0\025\x80"
-"jis0201\0\0\026\x80"
-
-"iso88592\0\0\x0a\x21"
-"\x04\x61\x1b\x14\x29\x3d\x69\x75\x0a\x2a"
-"\x60\x79\x45\x56\x5e\xad\xf4\xb5\x17\x2c"
-"\x05\x6d\x2b\x14\x2d\x3e\x6d\x75\x2c\x2e"
-"\x61\x7d\x55\x96\x5e\xdd\xfa\xc5\x17\x55"
-"\xc1\x08\x23\x10\x31\x39\x19\x74\x0c\x43"
-"\xc9\x60\xb4\x8c\x46\xcd\x38\xe3\x10\x44"
-"\x43\x1d\x35\x0d\x35\x50\x59\x73\x0d\x56"
-"\x6e\x69\x03\x17\x37\xdd\x88\xf5\x4d\x55"
-"\xe1\x88\x33\x10\x39\x3a\x1d\x74\x4e\x43"
-"\xe9\x64\xb4\xce\x46\xed\xb8\xf3\x50\x44"
-"\x44\x21\x35\x0f\x3d\x51\xd9\x73\x4f\x56"
-"\x6f\xe9\x13\x17\x3f\xfd\x8c\x95\x2d"
-
-"iso88593\0\0\x0a\x21"
-"\x26\x61\x3b\x0a\x29\x00\x90\x74\x0a\x2a"
-"\x30\x79\xe5\x11\x4d\xad\x00\xb0\x17\x2c"
-"\x27\xc9\x32\x0b\x2d\xb5\x94\x74\x0b\x2e"
-"\x31\x7d\xf5\x51\x4d\xbd\x00\xc0\x17\x30"
-"\xc1\x08\x03\x00\x31\x0a\x21\x74\x0c\x32"
-"\xc9\x28\xb3\x0c\x33\xcd\x38\xf3\x0c\x00"
-"\xd1\x48\x33\x0d\x35\x20\x59\x73\x0d\x47"
-"\xd9\x68\xb3\x0d\x37\x6c\x71\xf5\x0d\x38"
-"\xe1\x88\x03\x00\x39\x0b\x25\x74\x0e\x3a"
-"\xe9\xa8\xb3\x0e\x3b\xed\xb8\xf3\x0e\x00"
-"\xf1\xc8\x33\x0f\x3d\x21\xd9\x73\x4f\x47"
-"\xf9\xe8\xb3\x0f\x3f\x6d\x75\x95\x2d"
-
-"iso88594\0\0\x0a\x21"
-"\x04\xe1\x64\x15\x29\x28\xed\x74\x0a\x2a"
-"\x60\x49\x24\x92\x59\xad\xf4\xf5\x0a\x2c"
-"\x05\x6d\x7b\x15\x2d\x29\xf1\x74\x2c\x2e"
-"\x61\x4d\x34\xd2\x59\x4a\xf9\xb5\x14\x40"
-"\xc1\x08\x33\x0c\x31\xc5\x18\xe3\x12\x43"
-"\xc9\x60\xb4\x8c\x45\xcd\x38\xa3\x12\x44"
-"\x45\x31\x65\x13\x35\xd5\x58\x73\x0d\x36"
-"\x72\x69\xb3\x0d\x37\x68\xa9\xf5\x4d\x40"
-"\xe1\x88\x33\x0e\x39\xe5\x98\xf3\x52\x43"
-"\xe9\x64\xb4\xce\x45\xed\xb8\xb3\x52\x44"
-"\x46\x35\x75\x13\x3d\xf5\xd8\x73\x0f\x3e"
-"\x73\xe9\xb3\x0f\x3f\x69\xad\x95\x2d"
-
-"iso88595\0\0\x0e\x21"
-"\x01\x84\x00\x31\x40\x10\x10\x05\x84\x01"
-"\x71\x40\x20\x10\x09\x84\x02\xb1\x40\x30"
-"\x10\xad\x80\x03\xf1\x40\x40\x10\x11\x84"
-"\x04\x31\x41\x50\x10\x15\x84\x05\x71\x41"
-"\x60\x10\x19\x84\x06\xb1\x41\x70\x10\x1d"
-"\x84\x07\xf1\x41\x80\x10\x21\x84\x08\x31"
-"\x42\x90\x10\x25\x84\x09\x71\x42\xa0\x10"
-"\x29\x84\x0a\xb1\x42\xb0\x10\x2d\x84\x0b"
-"\xf1\x42\xc0\x10\x31\x84\x0c\x31\x43\xd0"
-"\x10\x35\x84\x0d\x71\x43\xe0\x10\x39\x84"
-"\x0e\xb1\x43\xf0\x10\x3d\x84\x0f\xf1\x43"
-"\x00\x11\x41\x84\x10\x31\x44\x10\x11\x45"
-"\x84\x11\x71\x44\x20\x11\x49\x84\x12\xb1"
-"\x44\x30\x11\x4d\x84\x13\xf1\x44\x58\x84"
-"\x51\x84\x14\x31\x45\x50\x11\x55\x84\x15"
-"\x71\x45\x60\x11\x59\x84\x16\xb1\x45\x70"
-"\x11\xa7\x80\x17\xf1\x45\x00"
-
-"iso88596\0\0\x0b\x21"
-"\x00\x00\x00\x00\x48\x01\x00\x00\x00\x00"
-"\x00\x00\x00\x00\x00\x18\xdc\x0a\x00\x00"
-"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-"\x00\x00\x00\x00\x00\xc0\x86\x01\x00\x00"
-"\x00\x7c\x18\x00\x21\x16\xf1\x88\x49\x5c"
-"\x62\x13\x9f\x18\xc5\x29\x56\xf1\x8a\x59"
-"\xdc\x62\x17\xbf\x18\xc6\x31\x96\xf1\x8c"
-"\x69\x5c\x63\x1b\xdf\x18\xc7\x39\xd6\x31"
-"\x00\x00\x00\x00\x00\x00\x00\xc8\x41\x16"
-"\xf2\x90\x89\x5c\x64\x23\x1f\x19\xc9\x49"
-"\x56\xf2\x92\x99\xdc\x64\x27\x3f\x19\xca"
-"\x51\x96\x32\x00\x00\x00\x00\x00\x00\x00"
-"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-"\x00"
-
-"iso88597\0\0\x0e\x21"
-"\x18\x60\x06\x38\x0a\xb0\x82\xaf\xa0\x29"
-"\x70\x0a\xa0\x02\xa9\x80\xde\xb0\x0a\xb0"
-"\x02\xad\x00\x00\x50\x01\xc2\x02\xb1\x80"
-"\x2c\x30\x0b\x10\x0e\x85\x83\xe1\x70\x0b"
-"\x20\x0e\x89\x83\xe2\xb0\x0b\x30\x0e\xbd"
-"\x80\xe3\xf0\x38\x40\x0e\x91\x83\xe4\x30"
-"\x39\x50\x0e\x95\x83\xe5\x70\x39\x60\x0e"
-"\x99\x83\xe6\xb0\x39\x70\x0e\x9d\x83\xe7"
-"\xf0\x39\x80\x0e\xa1\x03\x00\x30\x3a\x90"
-"\x0e\xa5\x83\xe9\x70\x3a\xa0\x0e\xa9\x83"
-"\xea\xb0\x3a\xb0\x0e\xad\x83\xeb\xf0\x3a"
-"\xc0\x0e\xb1\x83\xec\x30\x3b\xd0\x0e\xb5"
-"\x83\xed\x70\x3b\xe0\x0e\xb9\x83\xee\xb0"
-"\x3b\xf0\x0e\xbd\x83\xef\xf0\x3b\x00\x0f"
-"\xc1\x83\xf0\x30\x3c\x10\x0f\xc5\x83\xf1"
-"\x70\x3c\x20\x0f\xc9\x83\xf2\xb0\x3c\x30"
-"\x0f\xcd\x83\xf3\x00\x00\x00"
-
-"iso88598\0\0\x0e\x21"
-"\x00\x80\x28\x30\x0a\x90\x02\xa5\x80\x29"
-"\x70\x0a\xa0\x02\xa9\xc0\x35\xb0\x0a\xb0"
-"\x02\xad\x80\x2b\xf0\x0a\xc0\x02\xb1\x80"
-"\x2c\x30\x0b\xd0\x02\xb5\x80\x2d\x70\x0b"
-"\xe0\x02\xb9\xc0\x3d\xb0\x0b\xf0\x02\xbd"
-"\x80\x2f\x00\x00\x00\x00\x00\x00\x00\x00"
-"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-"\x00\x00\x00\x00\x00\x00\x00\x00\x70\x01"
-"\x42\x17\xd1\x85\x74\x31\x5d\x50\x17\xd5"
-"\x85\x75\x71\x5d\x60\x17\xd9\x85\x76\xb1"
-"\x5d\x70\x17\xdd\x85\x77\xf1\x5d\x80\x17"
-"\xe1\x85\x78\x31\x5e\x90\x17\xe5\x85\x79"
-"\x71\x5e\xa0\x17\xe9\x85\x7a\x01\x00\x00"
-"\x00\x0e\xe0\x03\x08\x00\x00"
-
-"iso88599\0\0\x09\x50"
-"\x1e\xa3\x49\x9b\x46\xad\x9a\xb5\x6b\xd8"
-"\xb2\x69\xdb\xc6\x0d\xa6\xd7\x6f\xe0\xc2"
-"\x89\x1b\x47\xae\x9c\xb9\x73\xe8\xd2\xa9"
-"\x5b\xc7\xae\x9d\xbb\x77\x1f\xe3\xc9\x9b"
-"\x47\xaf\x9e\xbd\x7b\xf8\xf2\xe9\xdb\xc7"
-"\x2f\xe6\xd7\x7f"
-
-"iso885910\0\0\x0e\x21"
-"\x04\x81\x44\x20\x12\xa8\x04\x28\x81\x4d"
-"\x70\x0a\xec\x04\x10\x01\x58\x60\x16\xf4"
-"\x05\xad\x80\x5a\xa0\x14\xc0\x02\x05\xc1"
-"\x44\x30\x12\xac\x04\x29\xc1\x4d\x70\x0b"
-"\xf0\x04\x11\x41\x58\x70\x16\xf8\x05\x15"
-"\xe0\x5a\xb0\x14\x00\x04\xc1\x80\x30\x30"
-"\x0c\x10\x03\xc5\x80\x31\xe0\x12\x30\x04"
-"\xc9\x00\x46\xb0\x0c\x58\x04\xcd\x80\x33"
-"\xf0\x0c\x40\x03\x45\x01\x53\x30\x0d\x50"
-"\x03\xd5\x80\x35\x80\x16\x60\x03\x72\x81"
-"\x36\xb0\x0d\x70\x03\xdd\x80\x37\xf0\x0d"
-"\x04\x04\xe1\x80\x38\x30\x0e\x90\x03\xe5"
-"\x80\x39\xf0\x12\x34\x04\xe9\x40\x46\xb0"
-"\x0e\x5c\x04\xed\x80\x3b\xf0\x0e\xc0\x03"
-"\x46\x41\x53\x30\x0f\xd0\x03\xf5\x80\x3d"
-"\x90\x16\xe0\x03\x73\x81\x3e\xb0\x0f\xf0"
-"\x03\xfd\x80\x3f\x80\x13\x00"
-
-"iso885913\0\0\x0e\x21"
-"\x1d\xa0\x28\x30\x0a\x90\x02\x1e\xa0\x29"
-"\x70\x0a\x60\x03\xa9\x80\x55\xb0\x0a\xb0"
-"\x02\xad\x80\x2b\x60\x0c\xc0\x02\xb1\x80"
-"\x2c\x30\x0b\x70\x80\xb5\x80\x2d\x70\x0b"
-"\xe0\x03\xb9\xc0\x55\xb0\x0b\xf0\x02\xbd"
-"\x80\x2f\x60\x0e\x10\x04\x2e\x01\x40\x60"
-"\x10\x10\x03\xc5\x00\x46\x20\x11\x30\x04"
-"\xc9\x40\x5e\x60\x11\x88\x04\x36\x81\x4a"
-"\xb0\x13\x80\x05\x43\x41\x51\x30\x0d\x30"
-"\x05\xd5\x80\x35\x70\x0d\xc8\x05\x41\x81"
-"\x56\xa0\x16\x70\x03\x7b\x41\x5f\xf0\x0d"
-"\x14\x04\x2f\x41\x40\x70\x10\x90\x03\xe5"
-"\x40\x46\x30\x11\x34\x04\xe9\x80\x5e\x70"
-"\x11\x8c\x04\x37\xc1\x4a\xc0\x13\x84\x05"
-"\x44\x81\x51\x30\x0f\x34\x05\xf5\x80\x3d"
-"\x70\x0f\xcc\x05\x42\xc1\x56\xb0\x16\xf0"
-"\x03\x7c\x81\x5f\x90\x01\x02"
-
-"iso885914\0\0\x0d\x21"
-"\x02\x7e\xc0\x8f\x02\x85\xb0\x10\x14\xfc"
-"\x29\x00\xf4\xa9\x40\xd0\x2f\x78\x79\xdf"
-"\x0a\x5c\x01\x5e\xf0\xf0\x1f\x1e\x24\x84"
-"\x04\x20\x1f\xe4\x6d\x81\x95\x0f\xf4\x57"
-"\x7e\xd0\x83\xf9\x79\x4f\xe8\x0b\x7d\x98"
-"\x07\x06\xc1\x40\x18\x0c\x03\x62\x50\x0c"
-"\x8c\xc1\x31\x40\x06\xc9\x40\x19\x2c\x03"
-"\x66\xd0\x0c\x9c\xc1\x33\xa0\x0b\xd1\x40"
-"\x1a\x4c\x03\x6a\x50\x0d\xac\x81\x9a\xc7"
-"\x06\xd9\x40\x1b\x6c\x03\x6e\xd0\x0d\xec"
-"\xc2\x37\x00\x07\xe1\x40\x1c\x8c\x03\x72"
-"\x50\x0e\xcc\xc1\x39\x40\x07\xe9\x40\x1d"
-"\xac\x03\x76\xd0\x0e\xdc\xc1\x3b\xa8\x0b"
-"\xf1\x40\x1e\xcc\x03\x7a\x50\x0f\xec\xc1"
-"\x9a\xc7\x07\xf9\x40\x1f\xec\x03\x7e\xd0"
-"\x0f\xee\xc2\x3f\x00"
-
-"iso885916\0\0\x0e\x21"
-"\x04\x41\x41\x10\x14\xb0\x82\x1e\x20\x58"
-"\x70\x0a\x84\x05\xa9\x00\x86\xb0\x0a\xe4"
-"\x05\xad\x80\x5e\xb0\x17\xc0\x02\xb1\x00"
-"\x43\x20\x14\xf4\x05\x1d\xa0\x2d\x70\x0b"
-"\xf8\x05\x0d\x41\x86\xb0\x0b\x48\x05\x53"
-"\x01\x5e\xc0\x17\x00\x03\xc1\x80\x30\x20"
-"\x10\x10\x03\x06\x81\x31\x70\x0c\x20\x03"
-"\xc9\x80\x32\xb0\x0c\x30\x03\xcd\x80\x33"
-"\xf0\x0c\x40\x04\x43\x81\x34\x30\x0d\x50"
-"\x03\x50\x81\x35\xa0\x15\xc0\x05\xd9\x80"
-"\x36\xb0\x0d\x70\x03\x18\x81\x86\xf0\x0d"
-"\x80\x03\xe1\x80\x38\x30\x10\x90\x03\x07"
-"\x81\x39\x70\x0e\xa0\x03\xe9\x80\x3a\xb0"
-"\x0e\xb0\x03\xed\x80\x3b\xf0\x0e\x44\x04"
-"\x44\x81\x3c\x30\x0f\xd0\x03\x51\x81\x3d"
-"\xb0\x15\xc4\x05\xf9\x80\x3e\xb0\x0f\xf0"
-"\x03\x19\xc1\x86\xf0\x0f\x00"
-
-"windows1252\0\0\x0e\x00"
-"\xac\x20\x00\xa0\x01\x4a\x06\x1e\xa0\x09"
-"\x08\x02\x86\x80\xc6\x02\x0c\x08\x16\xe4"
-"\x80\x52\x01\x00\xd0\x17\x00\x00\x00\x00"
-"\x06\x98\x01\x72\x80\x1d\xa0\x08\x38\x01"
-"\x52\x80\xdc\x82\x48\x18\x16\xe8\x80\x53"
-"\x01\x00\xe0\x17\xe0\x05\xa0\x40\x28\x20"
-"\x0a\x8c\x02\xa4\x40\x29\x60\x0a\x9c\x02"
-"\xa8\x40\x2a\xa0\x0a\xac\x02\xac\x40\x2b"
-"\xe0\x0a\xbc\x02\xb0\x40\x2c\x20\x0b\xcc"
-"\x02\xb4\x40\x2d\x60\x0b\xdc\x02\xb8\x40"
-"\x2e\xa0\x0b\xec\x02\xbc\x40\x2f\xe0\x0b"
-"\xfc\x02\xc0\x40\x30\x20\x0c\x0c\x03\xc4"
-"\x40\x31\x60\x0c\x1c\x03\xc8\x40\x32\xa0"
-"\x0c\x2c\x03\xcc\x40\x33\xe0\x0c\x3c\x03"
-"\xd0\x40\x34\x20\x0d\x4c\x03\xd4\x40\x35"
-"\x60\x0d\x5c\x03\xd8\x40\x36\xa0\x0d\x6c"
-"\x03\xdc\x40\x37\xe0\x0d\x7c\x03\xe0\x40"
-"\x38\x20\x0e\x8c\x03\xe4\x40\x39\x60\x0e"
-"\x9c\x03\xe8\x40\x3a\xa0\x0e\xac\x03\xec"
-"\x40\x3b\xe0\x0e\xbc\x03\xf0\x40\x3c\x20"
-"\x0f\xcc\x03\xf4\x40\x3d\x60\x0f\xdc\x03"
-"\xf8\x40\x3e\xa0\x0f\xec\x03\xfc\x40\x3f"
-"\xe0\x0f\xfc\x03"
+"utf8\0\0\310"
+"wchart\0\0\307"
+"ucs2\0ucs2be\0\0\304"
+"ucs2le\0\0\305"
+"utf16\0utf16be\0\0\302"
+"utf16le\0\0\301"
+"ucs4\0ucs4be\0utf32\0utf32be\0\0\300"
+"ucs4le\0utf32le\0\0\303"
+"ascii\0usascii\0iso646\0iso646us\0\0\306"
+#include "codepages.h"
;
-
+static const unsigned short legacy_chars[] = {
+#include "legacychars.h"
+};
static int fuzzycmp(const unsigned char *a, const unsigned char *b)
{
@@ -301,7 +62,10 @@ static size_t find_charmap(const void *name)
return s+1-charmaps;
}
s += strlen((void *)s)+1;
- if (!*s) s += ((128-s[2])*s[1]+7)/8 + 3;
+ if (!*s) {
+ if (s[1] > 0200) s+=2;
+ else s+=2+(128U-s[1])/4*5;
+ }
}
return -1;
}
@@ -338,36 +102,19 @@ static void put_16(unsigned char *s, unsigned c, int e)
static unsigned get_32(const unsigned char *s, int e)
{
+ e &= 3;
return s[e]+0U<<24 | s[e^1]<<16 | s[e^2]<<8 | s[e^3];
}
static void put_32(unsigned char *s, unsigned c, int e)
{
+ e &= 3;
s[e^0] = c>>24;
s[e^1] = c>>16;
s[e^2] = c>>8;
s[e^3] = c;
}
-
-
-#define GET_MAPPING(m, i, n) ( (1<<(n))-1 & ( \
- (m)[(i)*(n)/8] >> ((n)%8*(i)%8) | \
- (m)[(i)*(n)/8+1] << 8-((n)%8*(i)%8) | \
- (m)[(i)*(n)/8+2] << 16-((n)%8*(i)%8) ) )
-
-static unsigned get_mapping(const unsigned char *m, unsigned c, unsigned n)
-{
- switch (n) {
- default:
- case 9: return m[c*9/8]>>c%8 | m[c*9/8+1]<<8-c%8 & (1<<n)-1;
- case 10: return m[c*10/8]>>2*c%8 | m[c*10/8+1]<<8-2*c%8 & (1<<n)-1;
- case 11: return GET_MAPPING(m, c, 11);
- case 13: return GET_MAPPING(m, c, 13);
- case 14: return GET_MAPPING(m, c, 14);
- }
-}
-
/* Adapt as needed */
#define mbrtowc_utf8 mbrtowc
#define wctomb_utf8 wctomb
@@ -379,24 +126,23 @@ size_t iconv(iconv_t cd0, char **in, size_t *inb, char **out, size_t *outb)
unsigned long cd = (unsigned long)cd0;
unsigned to = cd & 0xffff;
unsigned from = cd >> 16;
- const unsigned char *map = charmaps+from+2;
- const unsigned char *tomap = charmaps+to+2;
+ const unsigned char *map = charmaps+from+1;
+ const unsigned char *tomap = charmaps+to+1;
mbstate_t st = {0};
wchar_t wc;
unsigned c, d;
size_t k, l;
int err;
- unsigned elide = map[-1] + 128;
- unsigned toelide = tomap[-1] + 128;
- unsigned char type = map[-2];
- unsigned char totype = tomap[-2];
+ unsigned char type = map[-1];
+ unsigned char totype = tomap[-1];
if (!in || !*in || !*inb) return 0;
for (; *inb; *in+=l, *inb-=l) {
c = *(unsigned char *)*in;
l = 1;
- if (type < 8 || c >= 0x80) switch (type) {
+
+ if (c >= 128) switch (type) {
case UTF_8:
l = mbrtowc_utf8(&wc, *in, *inb, &st);
if (!l) l++;
@@ -404,33 +150,8 @@ size_t iconv(iconv_t cd0, char **in, size_t *inb, char **out, size_t *outb)
else if (l == (size_t)-2) goto starved;
c = wc;
break;
- case LATIN_9:
- if ((unsigned)c - 0xa4 <= 0xbe - 0xa4) {
- static const unsigned char map[] = {
- 0, 0x60, 0, 0x61, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0x7d, 0, 0, 0, 0x7e, 0, 0, 0,
- 0x52, 0x53, 0x78
- };
- if (c == 0xa4) c = 0x20ac;
- else if (map[c-0xa5]) c = 0x100 | map[c-0xa5];
- }
- break;
- case TIS_620:
- if (c >= 0xa1) c += 0x0e01-0xa1;
- break;
- case JIS_0201:
- if (c >= 0xa1)
- if (c <= 0xdf) c += 0xff61-0xa1;
- else goto ilseq;
- break;
- case 9: case 10: case 11: case 13: case 14:
- if (c < elide) break;
- c = get_mapping(map, c-elide, type);
- if (!c) {
case US_ASCII:
- goto ilseq;
- }
- break;
+ goto ilseq;
case WCHAR_T:
l = sizeof(wchar_t);
if (*inb < l) goto starved;
@@ -461,6 +182,13 @@ size_t iconv(iconv_t cd0, char **in, size_t *inb, char **out, size_t *outb)
c = ((c-0xd800)<<10) | (d-0xdc00);
}
break;
+ default:
+ if (c < 128+type) break;
+ c -= 128+type;
+ c = legacy_chars[ map[c*5/4]>>2*c%8 |
+ map[c*5/4+1]<<8-2*c%8 & 1023 ];
+ if (!c) c = *(unsigned char *)*in;
+ if (c==1) goto ilseq;
}
switch (totype) {
@@ -480,51 +208,25 @@ size_t iconv(iconv_t cd0, char **in, size_t *inb, char **out, size_t *outb)
*out += k;
*outb -= k;
break;
- case TIS_620:
- if (c-0xe01u <= 0xff-0xa1)
- c -= 0xe01-0xa1;
- else if (c >= 0xa1)
- goto ascii;
- goto revout;
- case JIS_0201:
- if (c-0xff61u <= 0xdf-0xa1)
- c -= 0xff61-0xa1;
- else if (c >= 0xa1)
- goto ascii;
- goto revout;
- case LATIN_9:
- if (c == 0x20ac) {
- c=0xa4;
- } else if (c-0x150u<=0x12 && (1<<c-0x150 & 0x3000c)) {
- static const unsigned char map[] =
- { 0xa6,0xa8,0xbc,0xbd };
- c = map[c&3];
- } else if (c-0x178u<=0x7 && (1<<c-0x178 & 0x61)) {
- static const unsigned char map[] =
- { 0xbe,0,0,0,0,0xb4,0xb8 };
- c = map[c&7];
- } else if (c>0x100 ||
- c-0xa5u<=0xbeu-0xa5
- && (1<<c-0xa5 & 0x388800a))
- case US_ASCII: ascii:
- if (c > 0x7f) x++, c='*';
- case 9: case 10: case 11: case 13: case 14:
+ case US_ASCII:
+ if (c > 0x7f) subst: x++, c='*';
+ default:
if (*outb < 1) goto toobig;
- if (c < toelide) {
+ if (c < 128+totype) {
revout:
*(*out)++ = c;
*outb -= 1;
break;
}
- for (d=0; d<256-toelide; d++) {
- if (c == get_mapping(tomap, d, totype)) {
- c = d + toelide;
+ d = c;
+ for (c=0; c<128-totype; c++) {
+ if (d == legacy_chars[ map[c*5/4]>>2*c%8 |
+ map[c*5/4+1]<<8-2*c%8 & 1023 ]) {
+ c += 128;
goto revout;
}
}
- x++;
- c = '*';
- goto revout;
+ goto subst;
case UCS2BE:
case UCS2LE:
case UTF_16BE:
diff --git a/src/locale/legacychars.h b/src/locale/legacychars.h
new file mode 100644
index 00000000..4ddbaeba
--- /dev/null
+++ b/src/locale/legacychars.h
@@ -0,0 +1,39 @@
+0,1,160,167,168,169,175,176,178,183,184,198,215,216,230,247,248,256,257,258,
+259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,278,279,
+280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,
+299,302,303,304,305,308,309,310,311,312,313,314,315,316,317,318,321,322,323,
+324,325,326,327,328,330,331,332,333,336,337,338,339,340,341,342,343,344,345,
+346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,
+365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,402,
+416,417,431,432,536,537,538,539,710,711,728,729,731,732,733,768,769,771,777,
+803,890,900,901,902,904,905,906,908,910,911,912,913,914,915,916,917,918,919,
+920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,
+940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,
+959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1025,1026,
+1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1038,1039,1040,1041,1042,
+1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,
+1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,
+1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,
+1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,
+1103,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1118,1119,
+1168,1169,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1467,1468,1469,
+1470,1471,1472,1473,1474,1475,1488,1489,1490,1491,1492,1493,1494,1495,1496,
+1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,
+1512,1513,1514,1520,1521,1522,1523,1524,1548,1563,1567,1569,1570,1571,1572,
+1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,
+1588,1589,1590,1591,1592,1593,1594,1600,1601,1602,1603,1604,1605,1606,1607,
+1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,1657,1662,1670,1672,
+1681,1688,1705,1711,1722,1726,1729,1746,3585,3586,3587,3588,3589,3590,3591,
+3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3606,
+3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,
+3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,
+3637,3638,3639,3640,3641,3642,3647,3648,3649,3650,3651,3652,3653,3654,3655,
+3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,
+3671,3672,3673,3674,3675,7682,7683,7690,7691,7710,7711,7744,7745,7766,7767,
+7776,7777,7786,7787,7808,7809,7810,7811,7812,7813,7922,7923,8204,8205,8206,
+8207,8211,8212,8213,8215,8216,8217,8218,8220,8221,8222,8224,8225,8226,8230,
+8240,8249,8250,8362,8363,8364,8367,8470,8482,8729,8730,8776,8804,8805,8992,
+8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,
+9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,
+9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,
+9616,9617,9618,9619,9632,