diff --git a/intl/uconv/tests/unit/test_decode_CP850.js b/intl/uconv/tests/unit/test_decode_CP850.js new file mode 100644 index 000000000000..75fcac6ceddc --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_CP850.js @@ -0,0 +1,19 @@ +// Tests conversion from IBM850 to Unicode + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u00c1\u00c2\u00c0\u00a9\u2563\u2551\u2557\u255d\u00a2\u00a5\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u00e3\u00c3\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u00a4\u00f0\u00d0\u00ca\u00cb\u00c8\u20ac\u00cd\u00ce\u00cf\u2518\u250c\u2588\u2584\u00a6\u00cc\u2580\u00d3\u00df\u00d4\u00d2\u00f5\u00d5\u00b5\u00fe\u00de\u00da\u00db\u00d9\u00fd\u00dd\u00af\u00b4\u00ad\u00b1\u2017\u00be\u00b6\u00a7\u00f7\u00b8\u00b0\u00a8\u00b7\u00b9\u00b3\u00b2\u25a0\u00a0"; + +const charset = "IBM850"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertToUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_decode_CP852.js b/intl/uconv/tests/unit/test_decode_CP852.js new file mode 100644 index 000000000000..1a23196adf2e --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_CP852.js @@ -0,0 +1,19 @@ +// Tests conversion from IBM852 to Unicode + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c7\u00fc\u00e9\u00e2\u00e4\u016f\u0107\u00e7\u0142\u00eb\u0150\u0151\u00ee\u0179\u00c4\u0106\u00c9\u0139\u013a\u00f4\u00f6\u013d\u013e\u015a\u015b\u00d6\u00dc\u0164\u0165\u0141\u00d7\u010d\u00e1\u00ed\u00f3\u00fa\u0104\u0105\u017d\u017e\u0118\u0119\u20ac\u017a\u010c\u015f\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u00c1\u00c2\u011a\u015e\u2563\u2551\u2557\u255d\u017b\u017c\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u0102\u0103\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u00a4\u0111\u0110\u010e\u00cb\u010f\u0147\u00cd\u00ce\u011b\u2518\u250c\u2588\u2584\u0162\u016e\u2580\u00d3\u00df\u00d4\u0143\u0144\u0148\u0160\u0161\u0154\u00da\u0155\u0170\u00fd\u00dd\u0163\u00b4\u00ad\u02dd\u02db\u02c7\u02d8\u00a7\u00f7\u00b8\u00b0\u00a8\u02d9\u0171\u0158\u0159\u25a0\u00a0"; + +const charset = "IBM852"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertToUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_decode_CP855.js b/intl/uconv/tests/unit/test_decode_CP855.js new file mode 100644 index 000000000000..2dfa7affaeab --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_CP855.js @@ -0,0 +1,19 @@ +// Tests conversion from IBM855 to Unicode + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0452\u0402\u0453\u0403\u0451\u0401\u0454\u0404\u0455\u0405\u0456\u0406\u0457\u0407\u0458\u0408\u0459\u0409\u045a\u040a\u045b\u040b\u045c\u040c\u045e\u040e\u045f\u040f\u044e\u042e\u044a\u042a\u0430\u0410\u0431\u0411\u0446\u0426\u0434\u0414\u0435\u0415\u0444\u0424\u0433\u0413\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u0445\u0425\u0438\u0418\u2563\u2551\u2557\u255d\u0439\u0419\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u043a\u041a\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u00a4\u043b\u041b\u043c\u041c\u043d\u041d\u043e\u041e\u043f\u2518\u250c\u2588\u2584\u041f\u044f\u2580\u042f\u0440\u0420\u0441\u0421\u0442\u0422\u0443\u0423\u0436\u0416\u0432\u0412\u044c\u042c\u2116\u00ad\u044b\u042b\u0437\u0417\u0448\u0428\u044d\u042d\u0449\u0429\u0447\u0427\u00a7\u25a0\u00a0"; + +const charset = "IBM855"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertToUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_decode_CP857.js b/intl/uconv/tests/unit/test_decode_CP857.js new file mode 100644 index 000000000000..e471790a2152 --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_CP857.js @@ -0,0 +1,19 @@ +// Tests conversion from IBM857 to Unicode + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u0131\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u0130\u00d6\u00dc\u00f8\u00a3\u00d8\u015e\u015f\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u011e\u011f\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u00c1\u00c2\u00c0\u00a9\u2563\u2551\u2557\u255d\u00a2\u00a5\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u00e3\u00c3\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u00a4\u00ba\u00aa\u00ca\u00cb\u00c8\u20ac\u00cd\u00ce\u00cf\u2518\u250c\u2588\u2584\u00a6\u00cc\u2580\u00d3\u00df\u00d4\u00d2\u00f5\u00d5\u00b5\u00d7\u00da\u00db\u00d9\u00ec\u00ff\u00af\u00b4\u00ad\u00b1\u00be\u00b6\u00a7\u00f7\u00b8\u00b0\u00a8\u00b7\u00b9\u00b3\u00b2\u25a0\u00a0"; + +const charset = "IBM857"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertToUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_decode_CP862.js b/intl/uconv/tests/unit/test_decode_CP862.js new file mode 100644 index 000000000000..9c4b6b3328ca --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_CP862.js @@ -0,0 +1,19 @@ +// Tests conversion from IBM862 to Unicode + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u05d0\u05d1\u05d2\u05d3\u05d4\u05d5\u05d6\u05d7\u05d8\u05d9\u05da\u05db\u05dc\u05dd\u05de\u05df\u05e0\u05e1\u05e2\u05e3\u05e4\u05e5\u05e6\u05e7\u05e8\u05e9\u05ea\u00a2\u00a3\u00a5\u20aa\u200e\u200f\u202a\u202b\u202d\u202c\u202e\u2310\u00ac\u00bd\u00bc\u20ac\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u00df\u0393\u03c0\u03a3\u03c3\u00b5\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u03c6\u03b5\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u00a0"; + +const charset = "IBM862"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertToUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_decode_CP864.js b/intl/uconv/tests/unit/test_decode_CP864.js new file mode 100644 index 000000000000..fd8c9bb94150 --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_CP864.js @@ -0,0 +1,19 @@ +// Tests conversion from IBM864 to Unicode + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const expectedString = " !\"#$\u066a&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00b0\u00b7\u2219\u221a\u2592\u2500\u2502\u253c\u2524\u252c\u251c\u2534\u2510\u250c\u2514\u2518\u03b2\u221e\u03c6\u00b1\u00bd\u00bc\u2248\u00ab\u00bb\ufef7\ufef8\ufefb\ufefc\u00a0\u00ad\ufe82\u00a3\u00a4\ufe84\u20ac\ufe8e\ufe8f\ufe95\ufe99\u060c\ufe9d\ufea1\ufea5\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\ufed1\u061b\ufeb1\ufeb5\ufeb9\u061f\u00a2\ufe80\ufe81\ufe83\ufe85\ufeca\ufe8b\ufe8d\ufe91\ufe93\ufe97\ufe9b\ufe9f\ufea3\ufea7\ufea9\ufeab\ufead\ufeaf\ufeb3\ufeb7\ufebb\ufebf\ufec1\ufec5\ufecb\ufecf\u00a6\u00ac\u00f7\u00d7\ufec9\u0640\ufed3\ufed7\ufedb\ufedf\ufee3\ufee7\ufeeb\ufeed\ufeef\ufef3\ufebd\ufecc\ufece\ufecd\ufee1\ufe7d\u0651\ufee5\ufee9\ufeec\ufef0\ufef2\ufed0\ufed5\ufef5\ufef6\ufedd\ufed9\ufef1\u25a0"; + +const charset = "IBM864"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertToUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_decode_armscii.js b/intl/uconv/tests/unit/test_decode_armscii.js new file mode 100644 index 000000000000..fc724e1c9e0e --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_armscii.js @@ -0,0 +1,19 @@ +// Tests conversion from armscii-8 to Unicode + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0587\u0589)(\u00bb\u00ab\u2014.\u055d,-\u058a\u2026\u055c\u055b\u055e\u0531\u0561\u0532\u0562\u0533\u0563\u0534\u0564\u0535\u0565\u0536\u0566\u0537\u0567\u0538\u0568\u0539\u0569\u053a\u056a\u053b\u056b\u053c\u056c\u053d\u056d\u053e\u056e\u053f\u056f\u0540\u0570\u0541\u0571\u0542\u0572\u0543\u0573\u0544\u0574\u0545\u0575\u0546\u0576\u0547\u0577\u0548\u0578\u0549\u0579\u054a\u057a\u054b\u057b\u054c\u057c\u054d\u057d\u054e\u057e\u054f\u057f\u0550\u0580\u0551\u0581\u0552\u0582\u0553\u0583\u0554\u0584\u0555\u0585\u0556\u0586\u055a"; + +const charset = "armscii-8"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertToUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_decode_tcvn5712.js b/intl/uconv/tests/unit/test_decode_tcvn5712.js new file mode 100644 index 000000000000..8d536208ce9a --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_tcvn5712.js @@ -0,0 +1,19 @@ +// Tests conversion from x-viet-tcvn5712 to Unicode + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const expectedString = "\u00da\u1ee4\u1eea\u1eec\u1eee\u1ee8\u1ef0\u1ef2\u1ef6\u1ef8\u00dd\u1ef4 !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c0\u1ea2\u00c3\u00c1\u1ea0\u1eb6\u1eac\u00c8\u1eba\u1ebc\u00c9\u1eb8\u1ec6\u00cc\u1ec8\u0128\u00cd\u1eca\u00d2\u1ece\u00d5\u00d3\u1ecc\u1ed8\u1edc\u1ede\u1ee0\u1eda\u1ee2\u00d9\u1ee6\u0168\u00a0\u0102\u00c2\u00ca\u00d4\u01a0\u01af\u0110\u0103\u00e2\u00ea\u00f4\u01a1\u01b0\u0111\u1eb0\u0300\u0309\u0303\u0301\u0323\u00e0\u1ea3\u00e3\u00e1\u1ea1\u1eb2\u1eb1\u1eb3\u1eb5\u1eaf\u1eb4\u1eae\u1ea6\u1ea8\u1eaa\u1ea4\u1ec0\u1eb7\u1ea7\u1ea9\u1eab\u1ea5\u1ead\u00e8\u1ec2\u1ebb\u1ebd\u00e9\u1eb9\u1ec1\u1ec3\u1ec5\u1ebf\u1ec7\u00ec\u1ec9\u1ec4\u1ebe\u1ed2\u0129\u00ed\u1ecb\u00f2\u1ed4\u1ecf\u00f5\u00f3\u1ecd\u1ed3\u1ed5\u1ed7\u1ed1\u1ed9\u1edd\u1edf\u1ee1\u1edb\u1ee3\u00f9\u1ed6\u1ee7\u0169\u00fa\u1ee5\u1eeb\u1eed\u1eef\u1ee9\u1ef1\u1ef3\u1ef7\u1ef9\u00fd\u1ef5\u1ed0"; + +const charset = "x-viet-tcvn5712"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertToUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_decode_viscii.js b/intl/uconv/tests/unit/test_decode_viscii.js new file mode 100644 index 000000000000..290f8dd76038 --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_viscii.js @@ -0,0 +1,19 @@ +// Tests conversion from viscii to Unicode + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const expectedString = "\u1eb2\u1eb4\u1eaa\u1ef6\u1ef8\u1ef4 !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u1ea0\u1eae\u1eb0\u1eb6\u1ea4\u1ea6\u1ea8\u1eac\u1ebc\u1eb8\u1ebe\u1ec0\u1ec2\u1ec4\u1ec6\u1ed0\u1ed2\u1ed4\u1ed6\u1ed8\u1ee2\u1eda\u1edc\u1ede\u1eca\u1ece\u1ecc\u1ec8\u1ee6\u0168\u1ee4\u1ef2\u00d5\u1eaf\u1eb1\u1eb7\u1ea5\u1ea7\u1ea9\u1ead\u1ebd\u1eb9\u1ebf\u1ec1\u1ec3\u1ec5\u1ec7\u1ed1\u1ed3\u1ed5\u1ed7\u1ee0\u01a0\u1ed9\u1edd\u1edf\u1ecb\u1ef0\u1ee8\u1eea\u1eec\u01a1\u1edb\u01af\u00c0\u00c1\u00c2\u00c3\u1ea2\u0102\u1eb3\u1eb5\u00c8\u00c9\u00ca\u1eba\u00cc\u00cd\u0128\u1ef3\u0110\u1ee9\u00d2\u00d3\u00d4\u1ea1\u1ef7\u1eeb\u1eed\u00d9\u00da\u1ef9\u1ef5\u00dd\u1ee1\u01b0\u00e0\u00e1\u00e2\u00e3\u1ea3\u0103\u1eef\u1eab\u00e8\u00e9\u00ea\u1ebb\u00ec\u00ed\u0129\u1ec9\u0111\u1ef1\u00f2\u00f3\u00f4\u00f5\u1ecf\u1ecd\u1ee5\u00f9\u00fa\u0169\u1ee7\u00fd\u1ee3\u1eee"; + +const charset = "viscii"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertToUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_decode_vps.js b/intl/uconv/tests/unit/test_decode_vps.js new file mode 100644 index 000000000000..24ecf0a6254f --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_vps.js @@ -0,0 +1,19 @@ +// Tests conversion from x-viet-vps to Unicode + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const expectedString = "\u1ea0\u1eac\u1eb6\u1eb8\u1ec6\u1eca\u1ecc\u1ed8\u1ee2\u1ee4\u1ef0\u1ef4\u1eaa\u1eee !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c0\u1ea2\u00c3\u1ea4\u1ea6\u1ea8\u1ecd\u1ed7\u0102\u1ebf\u1ec1\u1ec3\u1ec7\u1eae\u1eb0\u1eb2\u1ebe\u2018\u2019\u1ec0\u1ec2\u1ec4\u1ed0\u1ed2\u1ed4\u1ed6\u00fd\u1ef7\u1ef5\u1eda\u1edc\u1ede\u00a0\u1eaf\u1eb1\u1eb3\u1eb5\u1eb7\u1ee0\u1edb\u00d9\u1edd\u1edf\u1ee1\u0168\u1ee8\u1ee3\u1eea\u1ed5\u1eec\u1ef2\u1ef8\u00cd\u00cc\u1ed9\u1ec8\u0128\u00d3\u1eed\u1eef\u00d2\u1ece\u00d5\u1ef1\u1ea7\u00c1\u00c2\u1ea5\u1ea9\u1eab\u1ead\u0111\u1ebb\u00c9\u00ca\u1eb9\u1ec9\u1ec5\u1ecb\u1ef9\u01af\u1ee6\u1ed3\u1ed1\u00d4\u1ecf\u01a1\u00c8\u1eeb\u1ee9\u00da\u0169\u01b0\u00dd\u1eba\u00df\u00e0\u00e1\u00e2\u00e3\u1ea3\u1ea1\u0103\u00e7\u00e8\u00e9\u00ea\u1ebd\u00ec\u00ed\u00ee\u0129\u1eb4\u0110\u00f2\u00f3\u00f4\u00f5\u00f6\u01a0\u1ee5\u00f9\u00fa\u1ee7\u00fc\u1ef6\u1ebc\u1ef3"; + +const charset = "x-viet-vps"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertToUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_decode_x_mac_arabic.js b/intl/uconv/tests/unit/test_decode_x_mac_arabic.js new file mode 100644 index 000000000000..531f188f7d70 --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_x_mac_arabic.js @@ -0,0 +1,19 @@ +// Tests conversion from x-mac-arabic to Unicode + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u00a0\u00c7\u00c9\u00d1\u00d6\u00dc\u00e1\u00e0\u00e2\u00e4\u06ba\u00ab\u00e7\u00e9\u00e8\u00ea\u00eb\u00ed\u2026\u00ee\u00ef\u00f1\u00f3\u00bb\u00f4\u00f6\u00f7\u00fa\u00f9\u00fb\u00fc !\"#$\u066a&'()*+\u060c-./\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669:\u061b<=>\u061f\u274a\u0621\u0622\u0623\u0624\u0625\u0626\u0627\u0628\u0629\u062a\u062b\u062c\u062d\u062e\u062f\u0630\u0631\u0632\u0633\u0634\u0635\u0636\u0637\u0638\u0639\u063a[\\]^_\u0640\u0641\u0642\u0643\u0644\u0645\u0646\u0647\u0648\u0649\u064a\u064b\u064c\u064d\u064e\u064f\u0650\u0651\u0652\u067e\u0679\u0686\u06d5\u06a4\u06af\u0688\u0691{|}\u0698\u06d2"; + +const charset = "x-mac-arabic"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertToUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_decode_x_mac_ce.js b/intl/uconv/tests/unit/test_decode_x_mac_ce.js new file mode 100644 index 000000000000..16184a3cba65 --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_x_mac_ce.js @@ -0,0 +1,19 @@ +// Tests conversion from x-mac-ce to Unicode + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u0100\u0101\u00c9\u0104\u00d6\u00dc\u00e1\u0105\u010c\u00e4\u010d\u0106\u0107\u00e9\u0179\u017a\u010e\u00ed\u010f\u0112\u0113\u0116\u00f3\u0117\u00f4\u00f6\u00f5\u00fa\u011a\u011b\u00fc\u2020\u00b0\u0118\u00a3\u00a7\u2022\u00b6\u00df\u00ae\u00a9\u2122\u0119\u00a8\u2260\u0123\u012e\u012f\u012a\u2264\u2265\u012b\u0136\u2202\u2211\u0142\u013b\u013c\u013d\u013e\u0139\u013a\u0145\u0146\u0143\u00ac\u221a\u0144\u0147\u2206\u00ab\u00bb\u2026\u00a0\u0148\u0150\u00d5\u0151\u014c\u2013\u2014\u201c\u201d\u2018\u2019\u00f7\u25ca\u014d\u0154\u0155\u0158\u2039\u203a\u0159\u0156\u0157\u0160\u201a\u201e\u0161\u015a\u015b\u00c1\u0164\u0165\u00cd\u017d\u017e\u016a\u00d3\u00d4\u016b\u016e\u00da\u016f\u0170\u0171\u0172\u0173\u00dd\u00fd\u0137\u017b\u0141\u017c\u0122\u02c7"; + +const charset = "x-mac-ce"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertToUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_decode_x_mac_croatian.js b/intl/uconv/tests/unit/test_decode_x_mac_croatian.js new file mode 100644 index 000000000000..7afdb8632751 --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_x_mac_croatian.js @@ -0,0 +1,19 @@ +// Tests conversion from x-mac-croatian to Unicode + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u00c5\u00c7\u00c9\u00d1\u00d6\u00dc\u00e1\u00e0\u00e2\u00e4\u00e3\u00e5\u00e7\u00e9\u00e8\u00ea\u00eb\u00ed\u00ec\u00ee\u00ef\u00f1\u00f3\u00f2\u00f4\u00f6\u00f5\u00fa\u00f9\u00fb\u00fc\u2020\u00b0\u00a2\u00a3\u00a7\u2022\u00b6\u00df\u00ae\u0160\u2122\u00b4\u00a8\u2260\u017d\u00d8\u221e\u00b1\u2264\u2265\u2206\u00b5\u2202\u2211\u220f\u0161\u222b\u00aa\u00ba\u03a9\u017e\u00f8\u00bf\u00a1\u00ac\u221a\u0192\u2248\u0106\u00ab\u010c\u2026\u00a0\u00c0\u00c3\u00d5\u0152\u0153\u0110\u2014\u201c\u201d\u2018\u2019\u00f7\u25ca\uf8ff\u00a9\u2044\u20ac\u2039\u203a\u00c6\u00bb\u2013\u00b7\u201a\u201e\u2030\u00c2\u0107\u00c1\u010d\u00c8\u00cd\u00ce\u00cf\u00cc\u00d3\u00d4\u0111\u00d2\u00da\u00db\u00d9\u0131\u02c6\u02dc\u00af\u03c0\u00cb\u02da\u00b8\u00ca\u00e6\u02c7"; + +const charset = "x-mac-croatian"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertToUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_decode_x_mac_cyrillic.js b/intl/uconv/tests/unit/test_decode_x_mac_cyrillic.js new file mode 100644 index 000000000000..afa403d1ba3b --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_x_mac_cyrillic.js @@ -0,0 +1,19 @@ +// Tests conversion from x-mac-cyrillic to Unicode + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041a\u041b\u041c\u041d\u041e\u041f\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042a\u042b\u042c\u042d\u042e\u042f\u2020\u00b0\u0490\u00a3\u00a7\u2022\u00b6\u0406\u00ae\u00a9\u2122\u0402\u0452\u2260\u0403\u0453\u221e\u00b1\u2264\u2265\u0456\u00b5\u0491\u0408\u0404\u0454\u0407\u0457\u0409\u0459\u040a\u045a\u0458\u0405\u00ac\u221a\u0192\u2248\u2206\u00ab\u00bb\u2026\u00a0\u040b\u045b\u040c\u045c\u0455\u2013\u2014\u201c\u201d\u2018\u2019\u00f7\u201e\u040e\u045e\u040f\u045f\u2116\u0401\u0451\u044f\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043a\u043b\u043c\u043d\u043e\u043f\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e\u20ac"; + +const charset = "x-mac-cyrillic"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertToUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_decode_x_mac_devanagari.js b/intl/uconv/tests/unit/test_decode_x_mac_devanagari.js new file mode 100644 index 000000000000..c38fc53472f1 --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_x_mac_devanagari.js @@ -0,0 +1,19 @@ +// Tests conversion from x-mac-devanagari to Unicode + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00d7\u2212\u2013\u2014\u2018\u2019\u2026\u2022\u00a9\u00ae\u2122\u0965\u0970\u0901\u0902\u0903\u0905\u0906\u0907\u0908\u0909\u090a\u090b\u090e\u090f\u0910\u090d\u0912\u0913\u0914\u0911\u0915\u0916\u0917\u0918\u0919\u091a\u091b\u091c\u091d\u091e\u091f\u0920\u0921\u0922\u0923\u0924\u0925\u0926\u0927\u0928\u0929\u092a\u092b\u092c\u092d\u092e\u092f\u095f\u0930\u0931\u0932\u0933\u0934\u0935\u0936\u0937\u0938\u0939\u200e\u093e\u093f\u0940\u0941\u0942\u0943\u0946\u0947\u0948\u0945\u094a\u094b\u094c\u0949\u094d\u093c\u0964\u0966\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f"; + +const charset = "x-mac-devanagari"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertToUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_decode_x_mac_farsi.js b/intl/uconv/tests/unit/test_decode_x_mac_farsi.js new file mode 100644 index 000000000000..f204594e1e81 --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_x_mac_farsi.js @@ -0,0 +1,19 @@ +// Tests conversion from x-mac-farsi to Unicode + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u00a0\u00c7\u00c9\u00d1\u00d6\u00dc\u00e1\u00e0\u00e2\u00e4\u06ba\u00ab\u00e7\u00e9\u00e8\u00ea\u00eb\u00ed\u2026\u00ee\u00ef\u00f1\u00f3\u00bb\u00f4\u00f6\u00f7\u00fa\u00f9\u00fb\u00fc !\"#$\u066a&'()*+\u060c-./\u06f0\u06f1\u06f2\u06f3\u06f4\u06f5\u06f6\u06f7\u06f8\u06f9:\u061b<=>\u061f\u274a\u0621\u0622\u0623\u0624\u0625\u0626\u0627\u0628\u0629\u062a\u062b\u062c\u062d\u062e\u062f\u0630\u0631\u0632\u0633\u0634\u0635\u0636\u0637\u0638\u0639\u063a[\\]^_\u0640\u0641\u0642\u0643\u0644\u0645\u0646\u0647\u0648\u0649\u064a\u064b\u064c\u064d\u064e\u064f\u0650\u0651\u0652\u067e\u0679\u0686\u06d5\u06a4\u06af\u0688\u0691{|}\u0698\u06d2"; + +const charset = "x-mac-farsi"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertToUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_decode_x_mac_greek.js b/intl/uconv/tests/unit/test_decode_x_mac_greek.js new file mode 100644 index 000000000000..c470b3449cfb --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_x_mac_greek.js @@ -0,0 +1,19 @@ +// Tests conversion from x-mac-greek to Unicode + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u00b9\u00b2\u00c9\u00b3\u00d6\u00dc\u0385\u00e0\u00e2\u00e4\u0384\u00a8\u00e7\u00e9\u00e8\u00ea\u00eb\u00a3\u2122\u00ee\u00ef\u2022\u00bd\u2030\u00f4\u00f6\u00a6\u20ac\u00f9\u00fb\u00fc\u2020\u0393\u0394\u0398\u039b\u039e\u03a0\u00df\u00ae\u00a9\u03a3\u03aa\u00a7\u2260\u00b0\u00b7\u0391\u00b1\u2264\u2265\u00a5\u0392\u0395\u0396\u0397\u0399\u039a\u039c\u03a6\u03ab\u03a8\u03a9\u03ac\u039d\u00ac\u039f\u03a1\u2248\u03a4\u00ab\u00bb\u2026\u00a0\u03a5\u03a7\u0386\u0388\u0153\u2013\u2015\u201c\u201d\u2018\u2019\u00f7\u0389\u038a\u038c\u038e\u03ad\u03ae\u03af\u03cc\u038f\u03cd\u03b1\u03b2\u03c8\u03b4\u03b5\u03c6\u03b3\u03b7\u03b9\u03be\u03ba\u03bb\u03bc\u03bd\u03bf\u03c0\u03ce\u03c1\u03c3\u03c4\u03b8\u03c9\u03c2\u03c7\u03c5\u03b6\u03ca\u03cb\u0390\u03b0\u00ad"; + +const charset = "x-mac-greek"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertToUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_decode_x_mac_gujarati.js b/intl/uconv/tests/unit/test_decode_x_mac_gujarati.js new file mode 100644 index 000000000000..c09c106e0067 --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_x_mac_gujarati.js @@ -0,0 +1,19 @@ +// Tests conversion from x-mac-gujarati to Unicode + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00d7\u2212\u2013\u2014\u2018\u2019\u2026\u2022\u00a9\u00ae\u2122\u0965\u0a81\u0a82\u0a83\u0a85\u0a86\u0a87\u0a88\u0a89\u0a8a\u0a8b\u0a8f\u0a90\u0a8d\u0a93\u0a94\u0a91\u0a95\u0a96\u0a97\u0a98\u0a99\u0a9a\u0a9b\u0a9c\u0a9d\u0a9e\u0a9f\u0aa0\u0aa1\u0aa2\u0aa3\u0aa4\u0aa5\u0aa6\u0aa7\u0aa8\u0aaa\u0aab\u0aac\u0aad\u0aae\u0aaf\u0ab0\u0ab2\u0ab3\u0ab5\u0ab6\u0ab7\u0ab8\u0ab9\u200e\u0abe\u0abf\u0ac0\u0ac1\u0ac2\u0ac3\u0ac7\u0ac8\u0ac5\u0acb\u0acc\u0ac9\u0acd\u0abc\u0964\u0ae6\u0ae7\u0ae8\u0ae9\u0aea\u0aeb\u0aec\u0aed\u0aee\u0aef"; + +const charset = "x-mac-gujarati"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertToUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_decode_x_mac_gurmukhi.js b/intl/uconv/tests/unit/test_decode_x_mac_gurmukhi.js new file mode 100644 index 000000000000..839b0645d908 --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_x_mac_gurmukhi.js @@ -0,0 +1,19 @@ +// Tests conversion from x-mac-gurmukhi to Unicode + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00d7\u2212\u2013\u2014\u2018\u2019\u2026\u2022\u00a9\u00ae\u2122\u0a71\u0a5c\u0a73\u0a72\u0a74\u0a02\u0a05\u0a06\u0a07\u0a08\u0a09\u0a0a\u0a0f\u0a10\u0a13\u0a14\u0a15\u0a16\u0a17\u0a18\u0a19\u0a1a\u0a1b\u0a1c\u0a1d\u0a1e\u0a1f\u0a20\u0a21\u0a22\u0a23\u0a24\u0a25\u0a26\u0a27\u0a28\u0a2a\u0a2b\u0a2c\u0a2d\u0a2e\u0a2f\u0a30\u0a32\u0a35\uf860\u0a38\u0a39\u200e\u0a3e\u0a3f\u0a40\u0a41\u0a42\u0a47\u0a48\u0a4b\u0a4c\u0a4d\u0a3c\u0964\u0a66\u0a67\u0a68\u0a69\u0a6a\u0a6b\u0a6c\u0a6d\u0a6e\u0a6f"; + +const charset = "x-mac-gurmukhi"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertToUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_decode_x_mac_hebrew.js b/intl/uconv/tests/unit/test_decode_x_mac_hebrew.js new file mode 100644 index 000000000000..f598a1748f1d --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_x_mac_hebrew.js @@ -0,0 +1,19 @@ +// Tests conversion from x-mac-hebrew to Unicode + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\ufb1f\u00c7\u00c9\u00d1\u00d6\u00dc\u00e1\u00e0\u00e2\u00e4\u00e3\u00e5\u00e7\u00e9\u00e8\u00ea\u00eb\u00ed\u00ec\u00ee\u00ef\u00f1\u00f3\u00f2\u00f4\u00f6\u00f5\u00fa\u00f9\u00fb\u00fc !\"#$%\u20aa'()*+,-./0123456789:;<=>?\ufffd\u201e\uf89b\uf89c\uf89d\uf89e\u05bc\ufb4b\ufb35\u2026\u00a0\u05b8\u05b7\u05b5\u05b6\u05b4\u2013\u2014\u201c\u201d\u2018\u2019\ufb2a\ufb2b\u05bf\u05b0\u05b2\u05b1\u05bb\u05b9\ufffd\u05b3\u05d0\u05d1\u05d2\u05d3\u05d4\u05d5\u05d6\u05d7\u05d8\u05d9\u05da\u05db\u05dc\u05dd\u05de\u05df\u05e0\u05e1\u05e2\u05e3\u05e4\u05e5\u05e6\u05e7\u05e8\u05e9\u05ea}]{[|"; + +const charset = "x-mac-hebrew"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertToUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_decode_x_mac_icelandic.js b/intl/uconv/tests/unit/test_decode_x_mac_icelandic.js new file mode 100644 index 000000000000..3a4c8dbff876 --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_x_mac_icelandic.js @@ -0,0 +1,19 @@ +// Tests conversion from x-mac-icelandic to Unicode + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u00c5\u00c7\u00c9\u00d1\u00d6\u00dc\u00e1\u00e0\u00e2\u00e4\u00e3\u00e5\u00e7\u00e9\u00e8\u00ea\u00eb\u00ed\u00ec\u00ee\u00ef\u00f1\u00f3\u00f2\u00f4\u00f6\u00f5\u00fa\u00f9\u00fb\u00fc\u00dd\u00b0\u00a2\u00a3\u00a7\u2022\u00b6\u00df\u00ae\u00a9\u2122\u00b4\u00a8\u2260\u00c6\u00d8\u221e\u00b1\u2264\u2265\u00a5\u00b5\u2202\u2211\u220f\u03c0\u222b\u00aa\u00ba\u03a9\u00e6\u00f8\u00bf\u00a1\u00ac\u221a\u0192\u2248\u2206\u00ab\u00bb\u2026\u00a0\u00c0\u00c3\u00d5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\u00f7\u25ca\u00ff\u0178\u2044\u20ac\u00d0\u00f0\u00de\u00fe\u00fd\u00b7\u201a\u201e\u2030\u00c2\u00ca\u00c1\u00cb\u00c8\u00cd\u00ce\u00cf\u00cc\u00d3\u00d4\uf8ff\u00d2\u00da\u00db\u00d9\u0131\u02c6\u02dc\u00af\u02d8\u02d9\u02da\u00b8\u02dd\u02db\u02c7"; + +const charset = "x-mac-icelandic"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertToUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_decode_x_mac_romanian.js b/intl/uconv/tests/unit/test_decode_x_mac_romanian.js new file mode 100644 index 000000000000..244e496bb5d4 --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_x_mac_romanian.js @@ -0,0 +1,19 @@ +// Tests conversion from x-mac-romanian to Unicode + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u00c5\u00c7\u00c9\u00d1\u00d6\u00dc\u00e1\u00e0\u00e2\u00e4\u00e3\u00e5\u00e7\u00e9\u00e8\u00ea\u00eb\u00ed\u00ec\u00ee\u00ef\u00f1\u00f3\u00f2\u00f4\u00f6\u00f5\u00fa\u00f9\u00fb\u00fc\u2020\u00b0\u00a2\u00a3\u00a7\u2022\u00b6\u00df\u00ae\u00a9\u2122\u00b4\u00a8\u2260\u0102\u0218\u221e\u00b1\u2264\u2265\u00a5\u00b5\u2202\u2211\u220f\u03c0\u222b\u00aa\u00ba\u03a9\u0103\u0219\u00bf\u00a1\u00ac\u221a\u0192\u2248\u2206\u00ab\u00bb\u2026\u00a0\u00c0\u00c3\u00d5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\u00f7\u25ca\u00ff\u0178\u2044\u20ac\u2039\u203a\u021a\u021b\u2021\u00b7\u201a\u201e\u2030\u00c2\u00ca\u00c1\u00cb\u00c8\u00cd\u00ce\u00cf\u00cc\u00d3\u00d4\uf8ff\u00d2\u00da\u00db\u00d9\u0131\u02c6\u02dc\u00af\u02d8\u02d9\u02da\u00b8\u02dd\u02db\u02c7"; + +const charset = "x-mac-romanian"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertToUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_decode_x_mac_turkish.js b/intl/uconv/tests/unit/test_decode_x_mac_turkish.js new file mode 100644 index 000000000000..f8f2722e3819 --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_x_mac_turkish.js @@ -0,0 +1,19 @@ +// Tests conversion from x-mac-turkish to Unicode + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u00c5\u00c7\u00c9\u00d1\u00d6\u00dc\u00e1\u00e0\u00e2\u00e4\u00e3\u00e5\u00e7\u00e9\u00e8\u00ea\u00eb\u00ed\u00ec\u00ee\u00ef\u00f1\u00f3\u00f2\u00f4\u00f6\u00f5\u00fa\u00f9\u00fb\u00fc\u2020\u00b0\u00a2\u00a3\u00a7\u2022\u00b6\u00df\u00ae\u00a9\u2122\u00b4\u00a8\u2260\u00c6\u00d8\u221e\u00b1\u2264\u2265\u00a5\u00b5\u2202\u2211\u220f\u03c0\u222b\u00aa\u00ba\u03a9\u00e6\u00f8\u00bf\u00a1\u00ac\u221a\u0192\u2248\u2206\u00ab\u00bb\u2026\u00a0\u00c0\u00c3\u00d5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\u00f7\u25ca\u00ff\u0178\u011e\u011f\u0130\u0131\u015e\u015f\u2021\u00b7\u201a\u201e\u2030\u00c2\u00ca\u00c1\u00cb\u00c8\u00cd\u00ce\u00cf\u00cc\u00d3\u00d4\uf8ff\u00d2\u00da\u00db\u00d9\uf8a0\u02c6\u02dc\u00af\u02d8\u02d9\u02da\u00b8\u02dd\u02db\u02c7"; + +const charset = "x-mac-turkish"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertToUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_decode_x_mac_ukrainian.js b/intl/uconv/tests/unit/test_decode_x_mac_ukrainian.js new file mode 100644 index 000000000000..7dfae69e0278 --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_x_mac_ukrainian.js @@ -0,0 +1,19 @@ +// Tests conversion from x-mac-ukrainian to Unicode + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041a\u041b\u041c\u041d\u041e\u041f\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042a\u042b\u042c\u042d\u042e\u042f\u2020\u00b0\u0490\u00a3\u00a7\u2022\u00b6\u0406\u00ae\u00a9\u2122\u0402\u0452\u2260\u0403\u0453\u221e\u00b1\u2264\u2265\u0456\u00b5\u0491\u0408\u0404\u0454\u0407\u0457\u0409\u0459\u040a\u045a\u0458\u0405\u00ac\u221a\u0192\u2248\u2206\u00ab\u00bb\u2026\u00a0\u040b\u045b\u040c\u045c\u0455\u2013\u2014\u201c\u201d\u2018\u2019\u00f7\u201e\u040e\u045e\u040f\u045f\u2116\u0401\u0451\u044f\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043a\u043b\u043c\u043d\u043e\u043f\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e\u20ac"; + +const charset = "x-mac-ukrainian"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertToUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_encode_CP850.js b/intl/uconv/tests/unit/test_encode_CP850.js new file mode 100644 index 000000000000..7dd8a355ca7d --- /dev/null +++ b/intl/uconv/tests/unit/test_encode_CP850.js @@ -0,0 +1,19 @@ +// Tests conversion from Unicode to IBM850 + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u00c1\u00c2\u00c0\u00a9\u2563\u2551\u2557\u255d\u00a2\u00a5\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u00e3\u00c3\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u00a4\u00f0\u00d0\u00ca\u00cb\u00c8\u20ac\u00cd\u00ce\u00cf\u2518\u250c\u2588\u2584\u00a6\u00cc\u2580\u00d3\u00df\u00d4\u00d2\u00f5\u00d5\u00b5\u00fe\u00de\u00da\u00db\u00d9\u00fd\u00dd\u00af\u00b4\u00ad\u00b1\u2017\u00be\u00b6\u00a7\u00f7\u00b8\u00b0\u00a8\u00b7\u00b9\u00b3\u00b2\u25a0\u00a0"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const charset = "IBM850"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertFromUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_encode_CP852.js b/intl/uconv/tests/unit/test_encode_CP852.js new file mode 100644 index 000000000000..5374b8c180f7 --- /dev/null +++ b/intl/uconv/tests/unit/test_encode_CP852.js @@ -0,0 +1,19 @@ +// Tests conversion from Unicode to IBM852 + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c7\u00fc\u00e9\u00e2\u00e4\u016f\u0107\u00e7\u0142\u00eb\u0150\u0151\u00ee\u0179\u00c4\u0106\u00c9\u0139\u013a\u00f4\u00f6\u013d\u013e\u015a\u015b\u00d6\u00dc\u0164\u0165\u0141\u00d7\u010d\u00e1\u00ed\u00f3\u00fa\u0104\u0105\u017d\u017e\u0118\u0119\u20ac\u017a\u010c\u015f\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u00c1\u00c2\u011a\u015e\u2563\u2551\u2557\u255d\u017b\u017c\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u0102\u0103\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u00a4\u0111\u0110\u010e\u00cb\u010f\u0147\u00cd\u00ce\u011b\u2518\u250c\u2588\u2584\u0162\u016e\u2580\u00d3\u00df\u00d4\u0143\u0144\u0148\u0160\u0161\u0154\u00da\u0155\u0170\u00fd\u00dd\u0163\u00b4\u00ad\u02dd\u02db\u02c7\u02d8\u00a7\u00f7\u00b8\u00b0\u00a8\u02d9\u0171\u0158\u0159\u25a0\u00a0"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const charset = "IBM852"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertFromUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_encode_CP855.js b/intl/uconv/tests/unit/test_encode_CP855.js new file mode 100644 index 000000000000..00dd7594afb0 --- /dev/null +++ b/intl/uconv/tests/unit/test_encode_CP855.js @@ -0,0 +1,19 @@ +// Tests conversion from Unicode to IBM855 + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0452\u0402\u0453\u0403\u0451\u0401\u0454\u0404\u0455\u0405\u0456\u0406\u0457\u0407\u0458\u0408\u0459\u0409\u045a\u040a\u045b\u040b\u045c\u040c\u045e\u040e\u045f\u040f\u044e\u042e\u044a\u042a\u0430\u0410\u0431\u0411\u0446\u0426\u0434\u0414\u0435\u0415\u0444\u0424\u0433\u0413\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u0445\u0425\u0438\u0418\u2563\u2551\u2557\u255d\u0439\u0419\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u043a\u041a\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u00a4\u043b\u041b\u043c\u041c\u043d\u041d\u043e\u041e\u043f\u2518\u250c\u2588\u2584\u041f\u044f\u2580\u042f\u0440\u0420\u0441\u0421\u0442\u0422\u0443\u0423\u0436\u0416\u0432\u0412\u044c\u042c\u2116\u00ad\u044b\u042b\u0437\u0417\u0448\u0428\u044d\u042d\u0449\u0429\u0447\u0427\u00a7\u25a0\u00a0"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const charset = "IBM855"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertFromUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_encode_CP857.js b/intl/uconv/tests/unit/test_encode_CP857.js new file mode 100644 index 000000000000..bb6fcabd335c --- /dev/null +++ b/intl/uconv/tests/unit/test_encode_CP857.js @@ -0,0 +1,19 @@ +// Tests conversion from Unicode to IBM857 + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u0131\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u0130\u00d6\u00dc\u00f8\u00a3\u00d8\u015e\u015f\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u011e\u011f\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u00c1\u00c2\u00c0\u00a9\u2563\u2551\u2557\u255d\u00a2\u00a5\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u00e3\u00c3\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u00a4\u00ba\u00aa\u00ca\u00cb\u00c8\u20ac\u00cd\u00ce\u00cf\u2518\u250c\u2588\u2584\u00a6\u00cc\u2580\u00d3\u00df\u00d4\u00d2\u00f5\u00d5\u00b5\u00d7\u00da\u00db\u00d9\u00ec\u00ff\u00af\u00b4\u00ad\u00b1\u00be\u00b6\u00a7\u00f7\u00b8\u00b0\u00a8\u00b7\u00b9\u00b3\u00b2\u25a0\u00a0"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const charset = "IBM857"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertFromUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_encode_CP862.js b/intl/uconv/tests/unit/test_encode_CP862.js new file mode 100644 index 000000000000..d2e758295269 --- /dev/null +++ b/intl/uconv/tests/unit/test_encode_CP862.js @@ -0,0 +1,19 @@ +// Tests conversion from Unicode to IBM862 + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u05d0\u05d1\u05d2\u05d3\u05d4\u05d5\u05d6\u05d7\u05d8\u05d9\u05da\u05db\u05dc\u05dd\u05de\u05df\u05e0\u05e1\u05e2\u05e3\u05e4\u05e5\u05e6\u05e7\u05e8\u05e9\u05ea\u00a2\u00a3\u00a5\u20aa\u200e\u200f\u202a\u202b\u202d\u202c\u202e\u2310\u00ac\u00bd\u00bc\u20ac\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u00df\u0393\u03c0\u03a3\u03c3\u00b5\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u03c6\u03b5\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u00a0"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const charset = "IBM862"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertFromUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_encode_CP864.js b/intl/uconv/tests/unit/test_encode_CP864.js new file mode 100644 index 000000000000..a269e04e29ad --- /dev/null +++ b/intl/uconv/tests/unit/test_encode_CP864.js @@ -0,0 +1,19 @@ +// Tests conversion from Unicode to IBM864 + +const inString = " !\"#$\u066a&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00b0\u00b7\u2219\u221a\u2592\u2500\u2502\u253c\u2524\u252c\u251c\u2534\u2510\u250c\u2514\u2518\u03b2\u221e\u03c6\u00b1\u00bd\u00bc\u2248\u00ab\u00bb\ufef7\ufef8\ufefb\ufefc\u00a0\u00ad\ufe82\u00a3\u00a4\ufe84\u20ac\ufe8e\ufe8f\ufe95\ufe99\u060c\ufe9d\ufea1\ufea5\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\ufed1\u061b\ufeb1\ufeb5\ufeb9\u061f\u00a2\ufe80\ufe81\ufe83\ufe85\ufeca\ufe8b\ufe8d\ufe91\ufe93\ufe97\ufe9b\ufe9f\ufea3\ufea7\ufea9\ufeab\ufead\ufeaf\ufeb3\ufeb7\ufebb\ufebf\ufec1\ufec5\ufecb\ufecf\u00a6\u00ac\u00f7\u00d7\ufec9\u0640\ufed3\ufed7\ufedb\ufedf\ufee3\ufee7\ufeeb\ufeed\ufeef\ufef3\ufebd\ufecc\ufece\ufecd\ufee1\ufe7d\u0651\ufee5\ufee9\ufeec\ufef0\ufef2\ufed0\ufed5\ufef5\ufef6\ufedd\ufed9\ufef1\u25a0"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const charset = "IBM864"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertFromUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_encode_armscii.js b/intl/uconv/tests/unit/test_encode_armscii.js new file mode 100644 index 000000000000..54e109ed8ede --- /dev/null +++ b/intl/uconv/tests/unit/test_encode_armscii.js @@ -0,0 +1,19 @@ +// Tests conversion from Unicode to armscii-8 + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0587\u0589\u00bb\u00ab\u2014\u055d\u058a\u2026\u055c\u055b\u055e\u0531\u0561\u0532\u0562\u0533\u0563\u0534\u0564\u0535\u0565\u0536\u0566\u0537\u0567\u0538\u0568\u0539\u0569\u053a\u056a\u053b\u056b\u053c\u056c\u053d\u056d\u053e\u056e\u053f\u056f\u0540\u0570\u0541\u0571\u0542\u0572\u0543\u0573\u0544\u0574\u0545\u0575\u0546\u0576\u0547\u0577\u0548\u0578\u0549\u0579\u054a\u057a\u054b\u057b\u054c\u057c\u054d\u057d\u054e\u057e\u054f\u057f\u0550\u0580\u0551\u0581\u0552\u0582\u0553\u0583\u0554\u0584\u0555\u0585\u0556\u0586\u055a"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const charset = "armscii-8"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertFromUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_encode_tcvn5712.js b/intl/uconv/tests/unit/test_encode_tcvn5712.js new file mode 100644 index 000000000000..8db88a8fcdf2 --- /dev/null +++ b/intl/uconv/tests/unit/test_encode_tcvn5712.js @@ -0,0 +1,19 @@ +// Tests conversion from Unicode to x-viet-tcvn5712 + +const inString = "\u00da\u1ee4\u1eea\u1eec\u1eee\u1ee8\u1ef0\u1ef2\u1ef6\u1ef8\u00dd\u1ef4 !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c0\u1ea2\u00c3\u00c1\u1ea0\u1eb6\u1eac\u00c8\u1eba\u1ebc\u00c9\u1eb8\u1ec6\u00cc\u1ec8\u0128\u00cd\u1eca\u00d2\u1ece\u00d5\u00d3\u1ecc\u1ed8\u1edc\u1ede\u1ee0\u1eda\u1ee2\u00d9\u1ee6\u0168\u00a0\u0102\u00c2\u00ca\u00d4\u01a0\u01af\u0110\u0103\u00e2\u00ea\u00f4\u01a1\u01b0\u0111\u1eb0\u0300\u0309\u0303\u0301\u0323\u00e0\u1ea3\u00e3\u00e1\u1ea1\u1eb2\u1eb1\u1eb3\u1eb5\u1eaf\u1eb4\u1eae\u1ea6\u1ea8\u1eaa\u1ea4\u1ec0\u1eb7\u1ea7\u1ea9\u1eab\u1ea5\u1ead\u00e8\u1ec2\u1ebb\u1ebd\u00e9\u1eb9\u1ec1\u1ec3\u1ec5\u1ebf\u1ec7\u00ec\u1ec9\u1ec4\u1ebe\u1ed2\u0129\u00ed\u1ecb\u00f2\u1ed4\u1ecf\u00f5\u00f3\u1ecd\u1ed3\u1ed5\u1ed7\u1ed1\u1ed9\u1edd\u1edf\u1ee1\u1edb\u1ee3\u00f9\u1ed6\u1ee7\u0169\u00fa\u1ee5\u1eeb\u1eed\u1eef\u1ee9\u1ef1\u1ef3\u1ef7\u1ef9\u00fd\u1ef5\u1ed0"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const charset = "x-viet-tcvn5712"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertFromUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_encode_viscii.js b/intl/uconv/tests/unit/test_encode_viscii.js new file mode 100644 index 000000000000..43f5e0da07ed --- /dev/null +++ b/intl/uconv/tests/unit/test_encode_viscii.js @@ -0,0 +1,19 @@ +// Tests conversion from Unicode to viscii + +const inString = "\u1eb2\u1eb4\u1eaa\u1ef6\u1ef8\u1ef4 !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u1ea0\u1eae\u1eb0\u1eb6\u1ea4\u1ea6\u1ea8\u1eac\u1ebc\u1eb8\u1ebe\u1ec0\u1ec2\u1ec4\u1ec6\u1ed0\u1ed2\u1ed4\u1ed6\u1ed8\u1ee2\u1eda\u1edc\u1ede\u1eca\u1ece\u1ecc\u1ec8\u1ee6\u0168\u1ee4\u1ef2\u00d5\u1eaf\u1eb1\u1eb7\u1ea5\u1ea7\u1ea9\u1ead\u1ebd\u1eb9\u1ebf\u1ec1\u1ec3\u1ec5\u1ec7\u1ed1\u1ed3\u1ed5\u1ed7\u1ee0\u01a0\u1ed9\u1edd\u1edf\u1ecb\u1ef0\u1ee8\u1eea\u1eec\u01a1\u1edb\u01af\u00c0\u00c1\u00c2\u00c3\u1ea2\u0102\u1eb3\u1eb5\u00c8\u00c9\u00ca\u1eba\u00cc\u00cd\u0128\u1ef3\u0110\u1ee9\u00d2\u00d3\u00d4\u1ea1\u1ef7\u1eeb\u1eed\u00d9\u00da\u1ef9\u1ef5\u00dd\u1ee1\u01b0\u00e0\u00e1\u00e2\u00e3\u1ea3\u0103\u1eef\u1eab\u00e8\u00e9\u00ea\u1ebb\u00ec\u00ed\u0129\u1ec9\u0111\u1ef1\u00f2\u00f3\u00f4\u00f5\u1ecf\u1ecd\u1ee5\u00f9\u00fa\u0169\u1ee7\u00fd\u1ee3\u1eee"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const charset = "viscii"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertFromUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_encode_vps.js b/intl/uconv/tests/unit/test_encode_vps.js new file mode 100644 index 000000000000..7d84ea677452 --- /dev/null +++ b/intl/uconv/tests/unit/test_encode_vps.js @@ -0,0 +1,19 @@ +// Tests conversion from Unicode to x-viet-vps + +const inString = "\u1ea0\u1eac\u1eb6\u1eb8\u1ec6\u1eca\u1ecc\u1ed8\u1ee2\u1ee4\u1ef0\u1ef4\u1eaa\u1eee !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c0\u1ea2\u00c3\u1ea4\u1ea6\u1ea8\u1ecd\u1ed7\u0102\u1ebf\u1ec1\u1ec3\u1ec7\u1eae\u1eb0\u1eb2\u1ebe\u2018\u2019\u1ec0\u1ec2\u1ec4\u1ed0\u1ed2\u1ed4\u1ed6\u00fd\u1ef7\u1ef5\u1eda\u1edc\u1ede\u00a0\u1eaf\u1eb1\u1eb3\u1eb5\u1eb7\u1ee0\u1edb\u00d9\u1edd\u1edf\u1ee1\u0168\u1ee8\u1ee3\u1eea\u1ed5\u1eec\u1ef2\u1ef8\u00cd\u00cc\u1ed9\u1ec8\u0128\u00d3\u1eed\u1eef\u00d2\u1ece\u00d5\u1ef1\u1ea7\u00c1\u00c2\u1ea5\u1ea9\u1eab\u1ead\u0111\u1ebb\u00c9\u00ca\u1eb9\u1ec9\u1ec5\u1ecb\u1ef9\u01af\u1ee6\u1ed3\u1ed1\u00d4\u1ecf\u01a1\u00c8\u1eeb\u1ee9\u00da\u0169\u01b0\u00dd\u1eba\u00df\u00e0\u00e1\u00e2\u00e3\u1ea3\u1ea1\u0103\u00e7\u00e8\u00e9\u00ea\u1ebd\u00ec\u00ed\u00ee\u0129\u1eb4\u0110\u00f2\u00f3\u00f4\u00f5\u00f6\u01a0\u1ee5\u00f9\u00fa\u1ee7\u00fc\u1ef6\u1ebc\u1ef3"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const charset = "x-viet-vps"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertFromUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_encode_x_mac_arabic.js b/intl/uconv/tests/unit/test_encode_x_mac_arabic.js new file mode 100644 index 000000000000..517963315e4e --- /dev/null +++ b/intl/uconv/tests/unit/test_encode_x_mac_arabic.js @@ -0,0 +1,19 @@ +// Tests conversion from Unicode to x-mac-arabic + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u00a0\u00c7\u00c9\u00d1\u00d6\u00dc\u00e1\u00e0\u00e2\u00e4\u06ba\u00ab\u00e7\u00e9\u00e8\u00ea\u00eb\u00ed\u2026\u00ee\u00ef\u00f1\u00f3\u00bb\u00f4\u00f6\u00f7\u00fa\u00f9\u00fb\u00fc !\"#$\u066a&'()*+\u060c-./\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669:\u061b<=>\u061f\u274a\u0621\u0622\u0623\u0624\u0625\u0626\u0627\u0628\u0629\u062a\u062b\u062c\u062d\u062e\u062f\u0630\u0631\u0632\u0633\u0634\u0635\u0636\u0637\u0638\u0639\u063a[\\]^_\u0640\u0641\u0642\u0643\u0644\u0645\u0646\u0647\u0648\u0649\u064a\u064b\u064c\u064d\u064e\u064f\u0650\u0651\u0652\u067e\u0679\u0686\u06d5\u06a4\u06af\u0688\u0691{|}\u0698\u06d2"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !\"#$&'()*+-./:<=>[\\]^_{|}"; + +const charset = "x-mac-arabic"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertFromUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_encode_x_mac_ce.js b/intl/uconv/tests/unit/test_encode_x_mac_ce.js new file mode 100644 index 000000000000..2cb46889ed0a --- /dev/null +++ b/intl/uconv/tests/unit/test_encode_x_mac_ce.js @@ -0,0 +1,19 @@ +// Tests conversion from Unicode to x-mac-ce + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u0100\u0101\u00c9\u0104\u00d6\u00dc\u00e1\u0105\u010c\u00e4\u010d\u0106\u0107\u00e9\u0179\u017a\u010e\u00ed\u010f\u0112\u0113\u0116\u00f3\u0117\u00f4\u00f6\u00f5\u00fa\u011a\u011b\u00fc\u2020\u00b0\u0118\u00a3\u00a7\u2022\u00b6\u00df\u00ae\u00a9\u2122\u0119\u00a8\u2260\u0123\u012e\u012f\u012a\u2264\u2265\u012b\u0136\u2202\u2211\u0142\u013b\u013c\u013d\u013e\u0139\u013a\u0145\u0146\u0143\u00ac\u221a\u0144\u0147\u2206\u00ab\u00bb\u2026\u00a0\u0148\u0150\u00d5\u0151\u014c\u2013\u2014\u201c\u201d\u2018\u2019\u00f7\u25ca\u014d\u0154\u0155\u0158\u2039\u203a\u0159\u0156\u0157\u0160\u201a\u201e\u0161\u015a\u015b\u00c1\u0164\u0165\u00cd\u017d\u017e\u016a\u00d3\u00d4\u016b\u016e\u00da\u016f\u0170\u0171\u0172\u0173\u00dd\u00fd\u0137\u017b\u0141\u017c\u0122\u02c7"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const charset = "x-mac-ce"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertFromUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_encode_x_mac_croatian.js b/intl/uconv/tests/unit/test_encode_x_mac_croatian.js new file mode 100644 index 000000000000..33e8dabaeb6f --- /dev/null +++ b/intl/uconv/tests/unit/test_encode_x_mac_croatian.js @@ -0,0 +1,19 @@ +// Tests conversion from Unicode to x-mac-croatian + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u00c5\u00c7\u00c9\u00d1\u00d6\u00dc\u00e1\u00e0\u00e2\u00e4\u00e3\u00e5\u00e7\u00e9\u00e8\u00ea\u00eb\u00ed\u00ec\u00ee\u00ef\u00f1\u00f3\u00f2\u00f4\u00f6\u00f5\u00fa\u00f9\u00fb\u00fc\u2020\u00b0\u00a2\u00a3\u00a7\u2022\u00b6\u00df\u00ae\u0160\u2122\u00b4\u00a8\u2260\u017d\u00d8\u221e\u00b1\u2264\u2265\u2206\u00b5\u2202\u2211\u220f\u0161\u222b\u00aa\u00ba\u03a9\u017e\u00f8\u00bf\u00a1\u00ac\u221a\u0192\u2248\u0106\u00ab\u010c\u2026\u00a0\u00c0\u00c3\u00d5\u0152\u0153\u0110\u2014\u201c\u201d\u2018\u2019\u00f7\u25ca\uf8ff\u00a9\u2044\u20ac\u2039\u203a\u00c6\u00bb\u2013\u00b7\u201a\u201e\u2030\u00c2\u0107\u00c1\u010d\u00c8\u00cd\u00ce\u00cf\u00cc\u00d3\u00d4\u0111\u00d2\u00da\u00db\u00d9\u0131\u02c6\u02dc\u00af\u03c0\u00cb\u02da\u00b8\u00ca\u00e6\u02c7"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const charset = "x-mac-croatian"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertFromUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_encode_x_mac_cyrillic.js b/intl/uconv/tests/unit/test_encode_x_mac_cyrillic.js new file mode 100644 index 000000000000..0e63b11e4507 --- /dev/null +++ b/intl/uconv/tests/unit/test_encode_x_mac_cyrillic.js @@ -0,0 +1,19 @@ +// Tests conversion from Unicode to x-mac-cyrillic + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041a\u041b\u041c\u041d\u041e\u041f\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042a\u042b\u042c\u042d\u042e\u042f\u2020\u00b0\u0490\u00a3\u00a7\u2022\u00b6\u0406\u00ae\u00a9\u2122\u0402\u0452\u2260\u0403\u0453\u221e\u00b1\u2264\u2265\u0456\u00b5\u0491\u0408\u0404\u0454\u0407\u0457\u0409\u0459\u040a\u045a\u0458\u0405\u00ac\u221a\u0192\u2248\u2206\u00ab\u00bb\u2026\u00a0\u040b\u045b\u040c\u045c\u0455\u2013\u2014\u201c\u201d\u2018\u2019\u00f7\u201e\u040e\u045e\u040f\u045f\u2116\u0401\u0451\u044f\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043a\u043b\u043c\u043d\u043e\u043f\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e\u20ac"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const charset = "x-mac-cyrillic"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertFromUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_encode_x_mac_devanagari.js b/intl/uconv/tests/unit/test_encode_x_mac_devanagari.js new file mode 100644 index 000000000000..eb775d8cfc85 --- /dev/null +++ b/intl/uconv/tests/unit/test_encode_x_mac_devanagari.js @@ -0,0 +1,19 @@ +// Tests conversion from Unicode to x-mac-devanagari + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00d7\u2212\u2013\u2014\u2018\u2019\u2026\u2022\u00a9\u00ae\u2122\u0965\u0970\u0901\u0902\u0903\u0905\u0906\u0907\u0908\u0909\u090a\u090b\u090e\u090f\u0910\u090d\u0912\u0913\u0914\u0911\u0915\u0916\u0917\u0918\u0919\u091a\u091b\u091c\u091d\u091e\u091f\u0920\u0921\u0922\u0923\u0924\u0925\u0926\u0927\u0928\u0929\u092a\u092b\u092c\u092d\u092e\u092f\u095f\u0930\u0931\u0932\u0933\u0934\u0935\u0936\u0937\u0938\u0939\u200e\u093e\u093f\u0940\u0941\u0942\u0943\u0946\u0947\u0948\u0945\u094a\u094b\u094c\u0949\u094d\u093c\u0964\u0966\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const charset = "x-mac-devanagari"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertFromUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_encode_x_mac_farsi.js b/intl/uconv/tests/unit/test_encode_x_mac_farsi.js new file mode 100644 index 000000000000..eb3f97c591ae --- /dev/null +++ b/intl/uconv/tests/unit/test_encode_x_mac_farsi.js @@ -0,0 +1,19 @@ +// Tests conversion from Unicode to x-mac-farsi + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u00a0\u00c7\u00c9\u00d1\u00d6\u00dc\u00e1\u00e0\u00e2\u00e4\u06ba\u00ab\u00e7\u00e9\u00e8\u00ea\u00eb\u00ed\u2026\u00ee\u00ef\u00f1\u00f3\u00bb\u00f4\u00f6\u00f7\u00fa\u00f9\u00fb\u00fc !\"#$\u066a&'()*+\u060c-./\u06f0\u06f1\u06f2\u06f3\u06f4\u06f5\u06f6\u06f7\u06f8\u06f9:\u061b<=>\u061f\u274a\u0621\u0622\u0623\u0624\u0625\u0626\u0627\u0628\u0629\u062a\u062b\u062c\u062d\u062e\u062f\u0630\u0631\u0632\u0633\u0634\u0635\u0636\u0637\u0638\u0639\u063a[\\]^_\u0640\u0641\u0642\u0643\u0644\u0645\u0646\u0647\u0648\u0649\u064a\u064b\u064c\u064d\u064e\u064f\u0650\u0651\u0652\u067e\u0679\u0686\u06d5\u06a4\u06af\u0688\u0691{|}\u0698\u06d2"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !\"#$&'()*+-./:<=>[\\]^_{|}"; + +const charset = "x-mac-farsi"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertFromUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_encode_x_mac_greek.js b/intl/uconv/tests/unit/test_encode_x_mac_greek.js new file mode 100644 index 000000000000..ff164168ca48 --- /dev/null +++ b/intl/uconv/tests/unit/test_encode_x_mac_greek.js @@ -0,0 +1,19 @@ +// Tests conversion from Unicode to x-mac-greek + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u00b9\u00b2\u00c9\u00b3\u00d6\u00dc\u0385\u00e0\u00e2\u00e4\u0384\u00a8\u00e7\u00e9\u00e8\u00ea\u00eb\u00a3\u2122\u00ee\u00ef\u2022\u00bd\u2030\u00f4\u00f6\u00a6\u20ac\u00f9\u00fb\u00fc\u2020\u0393\u0394\u0398\u039b\u039e\u03a0\u00df\u00ae\u00a9\u03a3\u03aa\u00a7\u2260\u00b0\u00b7\u0391\u00b1\u2264\u2265\u00a5\u0392\u0395\u0396\u0397\u0399\u039a\u039c\u03a6\u03ab\u03a8\u03a9\u03ac\u039d\u00ac\u039f\u03a1\u2248\u03a4\u00ab\u00bb\u2026\u00a0\u03a5\u03a7\u0386\u0388\u0153\u2013\u2015\u201c\u201d\u2018\u2019\u00f7\u0389\u038a\u038c\u038e\u03ad\u03ae\u03af\u03cc\u038f\u03cd\u03b1\u03b2\u03c8\u03b4\u03b5\u03c6\u03b3\u03b7\u03b9\u03be\u03ba\u03bb\u03bc\u03bd\u03bf\u03c0\u03ce\u03c1\u03c3\u03c4\u03b8\u03c9\u03c2\u03c7\u03c5\u03b6\u03ca\u03cb\u0390\u03b0\u00ad"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const charset = "x-mac-greek"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertFromUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_encode_x_mac_gujarati.js b/intl/uconv/tests/unit/test_encode_x_mac_gujarati.js new file mode 100644 index 000000000000..ebd5b6418a35 --- /dev/null +++ b/intl/uconv/tests/unit/test_encode_x_mac_gujarati.js @@ -0,0 +1,19 @@ +// Tests conversion from Unicode to x-mac-gujarati + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00d7\u2212\u2013\u2014\u2018\u2019\u2026\u2022\u00a9\u00ae\u2122\u0965\u0a81\u0a82\u0a83\u0a85\u0a86\u0a87\u0a88\u0a89\u0a8a\u0a8b\u0a8f\u0a90\u0a8d\u0a93\u0a94\u0a91\u0a95\u0a96\u0a97\u0a98\u0a99\u0a9a\u0a9b\u0a9c\u0a9d\u0a9e\u0a9f\u0aa0\u0aa1\u0aa2\u0aa3\u0aa4\u0aa5\u0aa6\u0aa7\u0aa8\u0aaa\u0aab\u0aac\u0aad\u0aae\u0aaf\u0ab0\u0ab2\u0ab3\u0ab5\u0ab6\u0ab7\u0ab8\u0ab9\u200e\u0abe\u0abf\u0ac0\u0ac1\u0ac2\u0ac3\u0ac7\u0ac8\u0ac5\u0acb\u0acc\u0ac9\u0acd\u0abc\u0964\u0ae6\u0ae7\u0ae8\u0ae9\u0aea\u0aeb\u0aec\u0aed\u0aee\u0aef"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const charset = "x-mac-gujarati"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertFromUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_encode_x_mac_gurmukhi.js b/intl/uconv/tests/unit/test_encode_x_mac_gurmukhi.js new file mode 100644 index 000000000000..9bf51afe803b --- /dev/null +++ b/intl/uconv/tests/unit/test_encode_x_mac_gurmukhi.js @@ -0,0 +1,19 @@ +// Tests conversion from Unicode to x-mac-gurmukhi + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00d7\u2212\u2013\u2014\u2018\u2019\u2026\u2022\u00a9\u00ae\u2122\u0a71\u0a5c\u0a73\u0a72\u0a74\u0a02\u0a05\u0a06\u0a07\u0a08\u0a09\u0a0a\u0a0f\u0a10\u0a13\u0a14\u0a15\u0a16\u0a17\u0a18\u0a19\u0a1a\u0a1b\u0a1c\u0a1d\u0a1e\u0a1f\u0a20\u0a21\u0a22\u0a23\u0a24\u0a25\u0a26\u0a27\u0a28\u0a2a\u0a2b\u0a2c\u0a2d\u0a2e\u0a2f\u0a30\u0a32\u0a35\uf860\u0a38\u0a39\u200e\u0a3e\u0a3f\u0a40\u0a41\u0a42\u0a47\u0a48\u0a4b\u0a4c\u0a4d\u0a3c\u0964\u0a66\u0a67\u0a68\u0a69\u0a6a\u0a6b\u0a6c\u0a6d\u0a6e\u0a6f"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const charset = "x-mac-gurmukhi"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertFromUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_encode_x_mac_hebrew.js b/intl/uconv/tests/unit/test_encode_x_mac_hebrew.js new file mode 100644 index 000000000000..b3e65b0375af --- /dev/null +++ b/intl/uconv/tests/unit/test_encode_x_mac_hebrew.js @@ -0,0 +1,19 @@ +// Tests conversion from Unicode to x-mac-hebrew + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\ufb1f\u00c7\u00c9\u00d1\u00d6\u00dc\u00e1\u00e0\u00e2\u00e4\u00e3\u00e5\u00e7\u00e9\u00e8\u00ea\u00eb\u00ed\u00ec\u00ee\u00ef\u00f1\u00f3\u00f2\u00f4\u00f6\u00f5\u00fa\u00f9\u00fb\u00fc\u20aa\u201e\uf89b\uf89c\uf89d\uf89e\u05bc\ufb4b\ufb35\u2026\u00a0\u05b8\u05b7\u05b5\u05b6\u05b4\u2013\u2014\u201c\u201d\u2018\u2019\ufb2a\ufb2b\u05bf\u05b0\u05b2\u05b1\u05bb\u05b9\u05b3\u05d0\u05d1\u05d2\u05d3\u05d4\u05d5\u05d6\u05d7\u05d8\u05d9\u05da\u05db\u05dc\u05dd\u05de\u05df\u05e0\u05e1\u05e2\u05e3\u05e4\u05e5\u05e6\u05e7\u05e8\u05e9\u05ea"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const charset = "x-mac-hebrew"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertFromUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_encode_x_mac_icelandic.js b/intl/uconv/tests/unit/test_encode_x_mac_icelandic.js new file mode 100644 index 000000000000..2000c77896c1 --- /dev/null +++ b/intl/uconv/tests/unit/test_encode_x_mac_icelandic.js @@ -0,0 +1,19 @@ +// Tests conversion from Unicode to x-mac-icelandic + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u00c5\u00c7\u00c9\u00d1\u00d6\u00dc\u00e1\u00e0\u00e2\u00e4\u00e3\u00e5\u00e7\u00e9\u00e8\u00ea\u00eb\u00ed\u00ec\u00ee\u00ef\u00f1\u00f3\u00f2\u00f4\u00f6\u00f5\u00fa\u00f9\u00fb\u00fc\u00dd\u00b0\u00a2\u00a3\u00a7\u2022\u00b6\u00df\u00ae\u00a9\u2122\u00b4\u00a8\u2260\u00c6\u00d8\u221e\u00b1\u2264\u2265\u00a5\u00b5\u2202\u2211\u220f\u03c0\u222b\u00aa\u00ba\u03a9\u00e6\u00f8\u00bf\u00a1\u00ac\u221a\u0192\u2248\u2206\u00ab\u00bb\u2026\u00a0\u00c0\u00c3\u00d5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\u00f7\u25ca\u00ff\u0178\u2044\u20ac\u00d0\u00f0\u00de\u00fe\u00fd\u00b7\u201a\u201e\u2030\u00c2\u00ca\u00c1\u00cb\u00c8\u00cd\u00ce\u00cf\u00cc\u00d3\u00d4\uf8ff\u00d2\u00da\u00db\u00d9\u0131\u02c6\u02dc\u00af\u02d8\u02d9\u02da\u00b8\u02dd\u02db\u02c7"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const charset = "x-mac-icelandic"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertFromUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_encode_x_mac_romanian.js b/intl/uconv/tests/unit/test_encode_x_mac_romanian.js new file mode 100644 index 000000000000..65ab12d7d3fb --- /dev/null +++ b/intl/uconv/tests/unit/test_encode_x_mac_romanian.js @@ -0,0 +1,19 @@ +// Tests conversion from Unicode to x-mac-romanian + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u00c5\u00c7\u00c9\u00d1\u00d6\u00dc\u00e1\u00e0\u00e2\u00e4\u00e3\u00e5\u00e7\u00e9\u00e8\u00ea\u00eb\u00ed\u00ec\u00ee\u00ef\u00f1\u00f3\u00f2\u00f4\u00f6\u00f5\u00fa\u00f9\u00fb\u00fc\u2020\u00b0\u00a2\u00a3\u00a7\u2022\u00b6\u00df\u00ae\u00a9\u2122\u00b4\u00a8\u2260\u0102\u0218\u221e\u00b1\u2264\u2265\u00a5\u00b5\u2202\u2211\u220f\u03c0\u222b\u00aa\u00ba\u03a9\u0103\u0219\u00bf\u00a1\u00ac\u221a\u0192\u2248\u2206\u00ab\u00bb\u2026\u00a0\u00c0\u00c3\u00d5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\u00f7\u25ca\u00ff\u0178\u2044\u20ac\u2039\u203a\u021a\u021b\u2021\u00b7\u201a\u201e\u2030\u00c2\u00ca\u00c1\u00cb\u00c8\u00cd\u00ce\u00cf\u00cc\u00d3\u00d4\uf8ff\u00d2\u00da\u00db\u00d9\u0131\u02c6\u02dc\u00af\u02d8\u02d9\u02da\u00b8\u02dd\u02db\u02c7"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const charset = "x-mac-romanian"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertFromUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_encode_x_mac_turkish.js b/intl/uconv/tests/unit/test_encode_x_mac_turkish.js new file mode 100644 index 000000000000..2e8c455d6de4 --- /dev/null +++ b/intl/uconv/tests/unit/test_encode_x_mac_turkish.js @@ -0,0 +1,19 @@ +// Tests conversion from Unicode to x-mac-turkish + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u00c4\u00c5\u00c7\u00c9\u00d1\u00d6\u00dc\u00e1\u00e0\u00e2\u00e4\u00e3\u00e5\u00e7\u00e9\u00e8\u00ea\u00eb\u00ed\u00ec\u00ee\u00ef\u00f1\u00f3\u00f2\u00f4\u00f6\u00f5\u00fa\u00f9\u00fb\u00fc\u2020\u00b0\u00a2\u00a3\u00a7\u2022\u00b6\u00df\u00ae\u00a9\u2122\u00b4\u00a8\u2260\u00c6\u00d8\u221e\u00b1\u2264\u2265\u00a5\u00b5\u2202\u2211\u220f\u03c0\u222b\u00aa\u00ba\u03a9\u00e6\u00f8\u00bf\u00a1\u00ac\u221a\u0192\u2248\u2206\u00ab\u00bb\u2026\u00a0\u00c0\u00c3\u00d5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\u00f7\u25ca\u00ff\u0178\u011e\u011f\u0130\u0131\u015e\u015f\u2021\u00b7\u201a\u201e\u2030\u00c2\u00ca\u00c1\u00cb\u00c8\u00cd\u00ce\u00cf\u00cc\u00d3\u00d4\uf8ff\u00d2\u00da\u00db\u00d9\uf8a0\u02c6\u02dc\u00af\u02d8\u02d9\u02da\u00b8\u02dd\u02db\u02c7"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const charset = "x-mac-turkish"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertFromUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +} diff --git a/intl/uconv/tests/unit/test_encode_x_mac_ukrainian.js b/intl/uconv/tests/unit/test_encode_x_mac_ukrainian.js new file mode 100644 index 000000000000..ed3c82bd0fcc --- /dev/null +++ b/intl/uconv/tests/unit/test_encode_x_mac_ukrainian.js @@ -0,0 +1,19 @@ +// Tests conversion from Unicode to x-mac-ukrainian + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041a\u041b\u041c\u041d\u041e\u041f\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042a\u042b\u042c\u042d\u042e\u042f\u2020\u00b0\u0490\u00a3\u00a7\u2022\u00b6\u0406\u00ae\u00a9\u2122\u0402\u0452\u2260\u0403\u0453\u221e\u00b1\u2264\u2265\u0456\u00b5\u0491\u0408\u0404\u0454\u0407\u0457\u0409\u0459\u040a\u045a\u0458\u0405\u00ac\u221a\u0192\u2248\u2206\u00ab\u00bb\u2026\u00a0\u040b\u045b\u040c\u045c\u0455\u2013\u2014\u201c\u201d\u2018\u2019\u00f7\u201e\u040e\u045e\u040f\u045f\u2116\u0401\u0451\u044f\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043a\u043b\u043c\u043d\u043e\u043f\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e\u20ac"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + +const charset = "x-mac-ukrainian"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outString = converter.ConvertFromUnicode(inString) + converter.Finish(); + do_check_eq(outString, expectedString); +}