diff --git a/enc/trans/ibm864-tbl.rb b/enc/trans/ibm864-tbl.rb new file mode 100644 index 0000000000..13f8a27f1d --- /dev/null +++ b/enc/trans/ibm864-tbl.rb @@ -0,0 +1,126 @@ +IBM864_TO_UCS_TBL = [ + ["80",0x00B0], + ["81",0x00B7], + ["82",0x2219], + ["83",0x221A], + ["84",0x2592], + ["85",0x2500], + ["86",0x2502], + ["87",0x253C], + ["88",0x2524], + ["89",0x252C], + ["8A",0x251C], + ["8B",0x2534], + ["8C",0x2510], + ["8D",0x250C], + ["8E",0x2514], + ["8F",0x2518], + ["90",0x03B2], + ["91",0x221E], + ["92",0x03C6], + ["93",0x00B1], + ["94",0x00BD], + ["95",0x00BC], + ["96",0x2248], + ["97",0x00AB], + ["98",0x00BB], + ["99",0xFEF7], + ["9A",0xFEF8], + ["9D",0xFEFB], + ["9E",0xFEFC], + ["9F",0xFE73], + ["A0",0x00A0], + ["A1",0x00AD], + ["A2",0xFE82], + ["A3",0x00A3], + ["A4",0x00A4], + ["A5",0xFE84], + ["A7",0x20AC], # Euro sign from CCSID 864 + ["A8",0xFE8E], + ["A9",0xFE8F], + ["AA",0xFE95], + ["AB",0xFE99], + ["AC",0x060C], + ["AD",0xFE9D], + ["AE",0xFEA1], + ["AF",0xFEA5], + ["B0",0x0660], + ["B1",0x0661], + ["B2",0x0662], + ["B3",0x0663], + ["B4",0x0664], + ["B5",0x0665], + ["B6",0x0666], + ["B7",0x0667], + ["B8",0x0668], + ["B9",0x0669], + ["BA",0xFED1], + ["BB",0x061B], + ["BC",0xFEB1], + ["BD",0xFEB5], + ["BE",0xFEB9], + ["BF",0x061F], + ["C0",0x00A2], + ["C1",0xFE80], + ["C2",0xFE81], + ["C3",0xFE83], + ["C4",0xFE85], + ["C5",0xFECA], + ["C6",0xFE8B], + ["C7",0xFE8D], + ["C8",0xFE91], + ["C9",0xFE93], + ["CA",0xFE97], + ["CB",0xFE9B], + ["CC",0xFE9F], + ["CD",0xFEA3], + ["CE",0xFEA7], + ["CF",0xFEA9], + ["D0",0xFEAB], + ["D1",0xFEAD], + ["D2",0xFEAF], + ["D3",0xFEB3], + ["D4",0xFEB7], + ["D5",0xFEBB], + ["D6",0xFEBF], + ["D7",0xFEC1], + ["D8",0xFEC5], + ["D9",0xFECB], + ["DA",0xFECF], + ["DB",0x00A6], + ["DC",0x00AC], + ["DD",0x00F7], + ["DE",0x00D7], + ["DF",0xFEC9], + ["E0",0x0640], + ["E1",0xFED3], + ["E2",0xFED7], + ["E3",0xFEDB], + ["E4",0xFEDF], + ["E5",0xFEE3], + ["E6",0xFEE7], + ["E7",0xFEEB], + ["E8",0xFEED], + ["E9",0xFEEF], + ["EA",0xFEF3], + ["EB",0xFEBD], + ["EC",0xFECC], + ["ED",0xFECE], + ["EE",0xFECD], + ["EF",0xFEE1], + ["F0",0xFE7D], + ["F1",0x0651], + ["F2",0xFEE5], + ["F3",0xFEE9], + ["F4",0xFEEC], + ["F5",0xFEF0], + ["F6",0xFEF2], + ["F7",0xFED0], + ["F8",0xFED5], + ["F9",0xFEF5], + ["FA",0xFEF6], + ["FB",0xFEDD], + ["FC",0xFED9], + ["FD",0xFEF1], + ["FE",0x25A0] +] diff --git a/enc/trans/single_byte.trans b/enc/trans/single_byte.trans index 0d5407b918..c326cbebea 100644 --- a/enc/trans/single_byte.trans +++ b/enc/trans/single_byte.trans @@ -61,6 +61,7 @@ transcode_tblgen_singlebyte "IBM861" transcode_tblgen_singlebyte "IBM862" transcode_tblgen_singlebyte "IBM863" + transcode_tblgen_singlebyte "IBM864" transcode_tblgen_singlebyte "IBM865" transcode_tblgen_singlebyte "IBM866" transcode_tblgen_singlebyte "IBM869" diff --git a/test/ruby/test_transcode.rb b/test/ruby/test_transcode.rb index ceef19e7ea..144f4d83a1 100644 --- a/test/ruby/test_transcode.rb +++ b/test/ruby/test_transcode.rb @@ -661,6 +661,25 @@ class TestTranscode < Test::Unit::TestCase check_both_ways("\u00A0", "\xFF", 'IBM863') # non-breaking space end + def test_IBM864 + check_both_ways("\u00B0", "\x80", 'IBM864') # ° + check_both_ways("\u2518", "\x8F", 'IBM864') # ┘ + check_both_ways("\u03B2", "\x90", 'IBM864') # β + check_both_ways("\uFE73", "\x9F", 'IBM864') # ﹳ + check_both_ways("\u00A0", "\xA0", 'IBM864') # non-breaking space + check_both_ways("\uFEA5", "\xAF", 'IBM864') # ﺥ + check_both_ways("\u0660", "\xB0", 'IBM864') # ٠ + check_both_ways("\u061F", "\xBF", 'IBM864') # ؟ + check_both_ways("\u00A2", "\xC0", 'IBM864') # ¢ + check_both_ways("\uFEA9", "\xCF", 'IBM864') # ﺩ + check_both_ways("\uFEAB", "\xD0", 'IBM864') # ﺫ + check_both_ways("\uFEC9", "\xDF", 'IBM864') # ﻉ + check_both_ways("\u0640", "\xE0", 'IBM864') # ـ + check_both_ways("\uFEE1", "\xEF", 'IBM864') # ﻡ + check_both_ways("\uFE7D", "\xF0", 'IBM864') # ﹽ + check_both_ways("\u25A0", "\xFE", 'IBM864') # ■ + end + def test_IBM865 check_both_ways("\u00C7", "\x80", 'IBM865') # Ç check_both_ways("\u00C5", "\x8F", 'IBM865') # Å