diff options
Diffstat (limited to 'enc/trans/utf_16_32.c')
-rw-r--r-- | enc/trans/utf_16_32.c | 266 |
1 files changed, 99 insertions, 167 deletions
diff --git a/enc/trans/utf_16_32.c b/enc/trans/utf_16_32.c index 562e12fbfe..b6b27aca7d 100644 --- a/enc/trans/utf_16_32.c +++ b/enc/trans/utf_16_32.c @@ -1,5 +1,5 @@ -/* Autogenerated, do not change */ -/* Report bugs to Martin Duerst (duerst@it.aoyama.ac.jp) */ +/* autogenerated. */ +/* src="utf_16_32.erb.c", len=8014, checksum=26811 */ #include "transcode_data.h" @@ -181,16 +181,9 @@ fun_so_to_utf_32le(const unsigned char* s, unsigned char* o) { return 4; } + static const unsigned char from_UTF_16BE_00_offsets[256] = { - /* used by from_UTF_16BE_00 */ - /* used by from_UTF_32BE_00_00_D8 */ - /* used by from_UTF_32BE_00_01 */ - /* used by from_UTF_32BE_00_11 */ - /* used by from_UTF_16BE_D8 */ - /* used by from_UTF_16LE */ - /* used by from_UTF_32LE */ - /* used by from_UTF_16LE_00_D8 */ 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, @@ -210,42 +203,26 @@ from_UTF_16BE_00_offsets[256] = { }; static const struct byte_lookup* const from_UTF_16BE_00_infos[1] = { - /* used by from_UTF_16BE_00 */ - /* used by to_UTF_32BE_C2 */ FUNso, }; static const BYTE_LOOKUP from_UTF_16BE_00 = { - /* used as from_UTF_16BE */ - /* used as from_UTF_32BE_00_00 */ - /* used as from_UTF_32BE_00_01 */ - /* used as from_UTF_16BE_D8_00 */ - /* used as from_UTF_32LE_00_00 */ - /* used as from_UTF_32LE_00_D8 */ from_UTF_16BE_00_offsets, from_UTF_16BE_00_infos }; static const struct byte_lookup* const -from_UTF_32BE_00_00_D8_infos[1] = { +from_UTF_16BE_D8_00_00_infos[1] = { INVALID, }; static const BYTE_LOOKUP -from_UTF_32BE_00_00_D8 = { - /* used as from_UTF_32BE_00_00 */ - /* used as from_UTF_32BE_00_11 */ - /* used as from_UTF_16BE_D8_00 */ - /* used as from_UTF_16BE */ - /* used as from_UTF_32LE_00_00 */ - /* used as from_UTF_32LE_00_D8 */ +from_UTF_16BE_D8_00_00 = { from_UTF_16BE_00_offsets, - from_UTF_32BE_00_00_D8_infos + from_UTF_16BE_D8_00_00_infos }; static const unsigned char from_UTF_16BE_D8_00_offsets[256] = { - /* used by from_UTF_16BE_D8_00 */ - /* used by from_UTF_16LE_00_D8_00 */ 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, @@ -265,9 +242,7 @@ from_UTF_16BE_D8_00_offsets[256] = { }; static const struct byte_lookup* const from_UTF_16BE_D8_00_infos[2] = { - /* used by from_UTF_16BE_D8_00 */ - /* used by from_UTF_32LE_00_D8 */ - &from_UTF_32BE_00_00_D8, &from_UTF_16BE_00, + &from_UTF_16BE_D8_00_00, &from_UTF_16BE_00, }; static const BYTE_LOOKUP from_UTF_16BE_D8_00 = { @@ -287,8 +262,6 @@ from_UTF_16BE_D8 = { static const unsigned char from_UTF_16BE_offsets[256] = { - /* used by from_UTF_16BE */ - /* used by from_UTF_16LE_00 */ 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, @@ -309,7 +282,7 @@ from_UTF_16BE_offsets[256] = { static const struct byte_lookup* const from_UTF_16BE_infos[3] = { &from_UTF_16BE_00, &from_UTF_16BE_D8, - &from_UTF_32BE_00_00_D8, + &from_UTF_16BE_D8_00_00, }; static const BYTE_LOOKUP from_UTF_16BE = { @@ -317,6 +290,8 @@ from_UTF_16BE = { from_UTF_16BE_infos }; + + static const rb_transcoder rb_from_UTF_16BE = { "UTF-16BE", "UTF-8", &from_UTF_16BE, 4, 0, @@ -324,165 +299,94 @@ rb_from_UTF_16BE = { }; static const unsigned char -to_UTF_32BE_C2_offsets[64] = { - /* used by to_UTF_32BE_C2 */ - /* used by to_UTF_32BE_E1 */ - /* used by to_UTF_32BE_F1 */ +to_UTF_16BE_C2_offsets[64] = { 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, }; static const BYTE_LOOKUP -to_UTF_32BE_C2 = { - /* used as to_UTF_32BE */ - /* used as to_UTF_16BE */ - /* used as to_UTF_32BE_E0 */ - /* used as to_UTF_16BE_E0 */ - /* used as to_UTF_16BE_E1 */ - /* used as to_UTF_32BE_E1 */ - /* used as to_UTF_32BE_ED */ - /* used as to_UTF_16BE_ED */ - /* used as to_UTF_16BE_F0_90 */ - /* used as to_UTF_32BE_F0_90 */ - /* used as to_UTF_16BE_F1_80 */ - /* used as to_UTF_32BE_F1_80 */ - /* used as to_UTF_32BE_F4_80 */ - /* used as to_UTF_16BE_F4_80 */ - /* used as to_UTF_16LE */ - /* used as to_UTF_32LE */ - /* used as to_UTF_16LE_E0 */ - /* used as to_UTF_32LE_E0 */ - /* used as to_UTF_32LE_E1 */ - /* used as to_UTF_16LE_E1 */ - /* used as to_UTF_32LE_ED */ - /* used as to_UTF_16LE_ED */ - /* used as to_UTF_16LE_F0_90 */ - /* used as to_UTF_32LE_F0_90 */ - /* used as to_UTF_16LE_F1_80 */ - /* used as to_UTF_32LE_F1_80 */ - /* used as to_UTF_16LE_F4_80 */ - /* used as to_UTF_32LE_F4_80 */ - to_UTF_32BE_C2_offsets, +to_UTF_16BE_C2 = { + to_UTF_16BE_C2_offsets, from_UTF_16BE_00_infos }; static const unsigned char -to_UTF_32BE_E0_offsets[64] = { - /* used by to_UTF_32BE_E0 */ - /* used by to_UTF_32BE_ED */ +to_UTF_16BE_E0_offsets[64] = { 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, }; static const struct byte_lookup* const -to_UTF_32BE_E0_infos[2] = { - INVALID, &to_UTF_32BE_C2, +to_UTF_16BE_E0_infos[2] = { + INVALID, &to_UTF_16BE_C2, }; static const BYTE_LOOKUP -to_UTF_32BE_E0 = { - /* used as to_UTF_32BE */ - /* used as to_UTF_16BE */ - /* used as to_UTF_16LE */ - /* used as to_UTF_32LE */ - to_UTF_32BE_E0_offsets, - to_UTF_32BE_E0_infos +to_UTF_16BE_E0 = { + to_UTF_16BE_E0_offsets, + to_UTF_16BE_E0_infos }; static const struct byte_lookup* const -to_UTF_32BE_E1_infos[1] = { - &to_UTF_32BE_C2, +to_UTF_16BE_E1_infos[1] = { + &to_UTF_16BE_C2, }; static const BYTE_LOOKUP -to_UTF_32BE_E1 = { - /* used as to_UTF_32BE */ - /* used as to_UTF_16BE */ - /* used as to_UTF_32BE_F0 */ - /* used as to_UTF_16BE_F0 */ - /* used as to_UTF_16BE_F1 */ - /* used as to_UTF_32BE_F1 */ - /* used as to_UTF_16BE_F4 */ - /* used as to_UTF_32BE_F4 */ - /* used as to_UTF_32LE */ - /* used as to_UTF_16LE */ - /* used as to_UTF_16LE_F0 */ - /* used as to_UTF_32LE_F0 */ - /* used as to_UTF_16LE_F1 */ - /* used as to_UTF_32LE_F1 */ - /* used as to_UTF_16LE_F4 */ - /* used as to_UTF_32LE_F4 */ - to_UTF_32BE_C2_offsets, - to_UTF_32BE_E1_infos +to_UTF_16BE_E1 = { + to_UTF_16BE_C2_offsets, + to_UTF_16BE_E1_infos }; static const struct byte_lookup* const -to_UTF_32BE_ED_infos[2] = { - &to_UTF_32BE_C2, INVALID, +to_UTF_16BE_ED_infos[2] = { + &to_UTF_16BE_C2, INVALID, }; static const BYTE_LOOKUP -to_UTF_32BE_ED = { - /* used as to_UTF_32BE */ - /* used as to_UTF_16BE */ - /* used as to_UTF_16LE */ - /* used as to_UTF_32LE */ - to_UTF_32BE_E0_offsets, - to_UTF_32BE_ED_infos +to_UTF_16BE_ED = { + to_UTF_16BE_E0_offsets, + to_UTF_16BE_ED_infos }; static const unsigned char -to_UTF_32BE_F0_offsets[64] = { - /* used by to_UTF_32BE_F0 */ - /* used by to_UTF_32BE_F4 */ +to_UTF_16BE_F0_offsets[64] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, }; static const struct byte_lookup* const -to_UTF_32BE_F0_infos[2] = { - INVALID, &to_UTF_32BE_E1, +to_UTF_16BE_F0_infos[2] = { + INVALID, &to_UTF_16BE_E1, }; static const BYTE_LOOKUP -to_UTF_32BE_F0 = { - /* used as to_UTF_32BE */ - /* used as to_UTF_16BE */ - /* used as to_UTF_16LE */ - /* used as to_UTF_32LE */ - to_UTF_32BE_F0_offsets, - to_UTF_32BE_F0_infos +to_UTF_16BE_F0 = { + to_UTF_16BE_F0_offsets, + to_UTF_16BE_F0_infos }; static const struct byte_lookup* const -to_UTF_32BE_F1_infos[1] = { - &to_UTF_32BE_E1, +to_UTF_16BE_F1_infos[1] = { + &to_UTF_16BE_E1, }; static const BYTE_LOOKUP -to_UTF_32BE_F1 = { - /* used as to_UTF_32BE */ - /* used as to_UTF_16BE */ - /* used as to_UTF_16LE */ - /* used as to_UTF_32LE */ - to_UTF_32BE_C2_offsets, - to_UTF_32BE_F1_infos +to_UTF_16BE_F1 = { + to_UTF_16BE_C2_offsets, + to_UTF_16BE_F1_infos }; static const struct byte_lookup* const -to_UTF_32BE_F4_infos[2] = { - &to_UTF_32BE_E1, INVALID, +to_UTF_16BE_F4_infos[2] = { + &to_UTF_16BE_E1, INVALID, }; static const BYTE_LOOKUP -to_UTF_32BE_F4 = { - /* used as to_UTF_32BE */ - /* used as to_UTF_16BE */ - /* used as to_UTF_16LE */ - /* used as to_UTF_32LE */ - to_UTF_32BE_F0_offsets, - to_UTF_32BE_F4_infos +to_UTF_16BE_F4 = { + to_UTF_16BE_F0_offsets, + to_UTF_16BE_F4_infos }; static const unsigned char -to_UTF_32BE_offsets[256] = { +to_UTF_16BE_offsets[256] = { 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, @@ -501,24 +405,22 @@ to_UTF_32BE_offsets[256] = { 6, 7, 7, 7, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, }; static const struct byte_lookup* const -to_UTF_32BE_infos[9] = { - FUNso, INVALID, &to_UTF_32BE_C2, &to_UTF_32BE_E0, - &to_UTF_32BE_E1, &to_UTF_32BE_ED, &to_UTF_32BE_F0, &to_UTF_32BE_F1, - &to_UTF_32BE_F4, +to_UTF_16BE_infos[9] = { + FUNso, INVALID, &to_UTF_16BE_C2, &to_UTF_16BE_E0, + &to_UTF_16BE_E1, &to_UTF_16BE_ED, &to_UTF_16BE_F0, &to_UTF_16BE_F1, + &to_UTF_16BE_F4, }; static const BYTE_LOOKUP -to_UTF_32BE = { - /* used as to_UTF_32BE */ - /* used as to_UTF_16BE */ - /* used as to_UTF_16LE */ - /* used as to_UTF_32LE */ - to_UTF_32BE_offsets, - to_UTF_32BE_infos +to_UTF_16BE = { + to_UTF_16BE_offsets, + to_UTF_16BE_infos }; + + static const rb_transcoder rb_to_UTF_16BE = { - "UTF-8", "UTF-16BE", &to_UTF_32BE, 4, 1, + "UTF-8", "UTF-16BE", &to_UTF_16BE, 4, 1, NULL, NULL, NULL, NULL, NULL, &fun_so_to_utf_16be }; @@ -563,6 +465,8 @@ from_UTF_16LE = { from_UTF_16LE_infos }; + + static const rb_transcoder rb_from_UTF_16LE = { "UTF-16LE", "UTF-8", &from_UTF_16LE, 4, 0, @@ -571,14 +475,12 @@ rb_from_UTF_16LE = { static const rb_transcoder rb_to_UTF_16LE = { - "UTF-8", "UTF-16LE", &to_UTF_32BE, 4, 1, + "UTF-8", "UTF-16LE", &to_UTF_16BE, 4, 1, NULL, NULL, NULL, NULL, NULL, &fun_so_to_utf_16le }; static const unsigned char from_UTF_32BE_00_00_offsets[256] = { - /* used by from_UTF_32BE_00_00 */ - /* used by from_UTF_32LE_00 */ 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, @@ -598,9 +500,7 @@ from_UTF_32BE_00_00_offsets[256] = { }; static const struct byte_lookup* const from_UTF_32BE_00_00_infos[2] = { - /* used by from_UTF_32BE_00_00 */ - /* used by from_UTF_32LE_00_00 */ - &from_UTF_16BE_00, &from_UTF_32BE_00_00_D8, + &from_UTF_16BE_00, &from_UTF_16BE_D8_00_00, }; static const BYTE_LOOKUP from_UTF_32BE_00_00 = { @@ -620,7 +520,7 @@ from_UTF_32BE_00_01 = { static const struct byte_lookup* const from_UTF_32BE_00_11_infos[1] = { - &from_UTF_32BE_00_00_D8, + &from_UTF_16BE_D8_00_00, }; static const BYTE_LOOKUP from_UTF_32BE_00_11 = { @@ -658,6 +558,16 @@ from_UTF_32BE_00 = { from_UTF_32BE_00_infos }; +static const struct byte_lookup* const +from_UTF_32BE_01_infos[1] = { + &from_UTF_32BE_00_11, +}; +static const BYTE_LOOKUP +from_UTF_32BE_01 = { + from_UTF_16BE_00_offsets, + from_UTF_32BE_01_infos +}; + static const unsigned char from_UTF_32BE_offsets[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -679,7 +589,7 @@ from_UTF_32BE_offsets[256] = { }; static const struct byte_lookup* const from_UTF_32BE_infos[2] = { - &from_UTF_32BE_00, INVALID, + &from_UTF_32BE_00, &from_UTF_32BE_01, }; static const BYTE_LOOKUP from_UTF_32BE = { @@ -687,6 +597,8 @@ from_UTF_32BE = { from_UTF_32BE_infos }; + + static const rb_transcoder rb_from_UTF_32BE = { "UTF-32BE", "UTF-8", &from_UTF_32BE, 4, 0, @@ -695,10 +607,20 @@ rb_from_UTF_32BE = { static const rb_transcoder rb_to_UTF_32BE = { - "UTF-8", "UTF-32BE", &to_UTF_32BE, 4, 1, + "UTF-8", "UTF-32BE", &to_UTF_16BE, 4, 1, NULL, NULL, NULL, NULL, NULL, &fun_so_to_utf_32be }; +static const struct byte_lookup* const +from_UTF_32LE_00_00_00_infos[2] = { + FUNso, INVALID, +}; +static const BYTE_LOOKUP +from_UTF_32LE_00_00_00 = { + from_UTF_32BE_offsets, + from_UTF_32LE_00_00_00_infos +}; + static const unsigned char from_UTF_32LE_00_00_offsets[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -718,10 +640,14 @@ from_UTF_32LE_00_00_offsets[256] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, }; +static const struct byte_lookup* const +from_UTF_32LE_00_00_infos[2] = { + &from_UTF_32LE_00_00_00, &from_UTF_16BE_D8_00_00, +}; static const BYTE_LOOKUP from_UTF_32LE_00_00 = { from_UTF_32LE_00_00_offsets, - from_UTF_32BE_00_00_infos + from_UTF_32LE_00_00_infos }; static const unsigned char @@ -743,10 +669,14 @@ from_UTF_32LE_00_D8_offsets[256] = { 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, }; +static const struct byte_lookup* const +from_UTF_32LE_00_D8_infos[2] = { + &from_UTF_16BE_D8_00_00, &from_UTF_32LE_00_00_00, +}; static const BYTE_LOOKUP from_UTF_32LE_00_D8 = { from_UTF_32LE_00_D8_offsets, - from_UTF_16BE_D8_00_infos + from_UTF_32LE_00_D8_infos }; static const struct byte_lookup* const @@ -769,6 +699,8 @@ from_UTF_32LE = { from_UTF_32LE_infos }; + + static const rb_transcoder rb_from_UTF_32LE = { "UTF-32LE", "UTF-8", &from_UTF_32LE, 4, 0, @@ -777,7 +709,7 @@ rb_from_UTF_32LE = { static const rb_transcoder rb_to_UTF_32LE = { - "UTF-8", "UTF-32LE", &to_UTF_32BE, 4, 1, + "UTF-8", "UTF-32LE", &to_UTF_16BE, 4, 1, NULL, NULL, NULL, NULL, NULL, &fun_so_to_utf_32le }; @@ -793,4 +725,4 @@ Init_utf_16_32(void) rb_register_transcoder(&rb_from_UTF_32LE); rb_register_transcoder(&rb_to_UTF_32LE); } -/* Footprint (bytes): gross: 13684, saved: 10796, net: 2888 */ + |