diff --git a/intl/uconv/tests/unit/test_bug116882.js b/intl/uconv/tests/unit/test_bug116882.js new file mode 100644 index 000000000000..95097eaa839e --- /dev/null +++ b/intl/uconv/tests/unit/test_bug116882.js @@ -0,0 +1,19 @@ +/* Tests conversion of undefined and illegal sequences from Shift-JIS + * to Unicode (bug 116882) + */ + +const inText = "\xfd\xfe\xff\x81\x20\x81\x3f\x86\x3c"; +const expectedText = "\uf8f1\uf8f2\uf8f3\u30fb\u30fb\u30fb"; +const charset = "Shift_JIS"; + +function run_test() { + var ScriptableUnicodeConverter = + Components.Constructor("@mozilla.org/intl/scriptableunicodeconverter", + "nsIScriptableUnicodeConverter"); + + var converter = new ScriptableUnicodeConverter(); + converter.charset = charset; + + var outText = converter.ConvertToUnicode(inText) + converter.Finish(); + do_check_eq(outText, expectedText); +} diff --git a/layout/reftests/bugs/116882-1-ref.html b/layout/reftests/bugs/116882-1-ref.html new file mode 100644 index 000000000000..1fdc3efabca6 --- /dev/null +++ b/layout/reftests/bugs/116882-1-ref.html @@ -0,0 +1,11 @@ + + + + Shift_JIS illegal sequences + + + +

・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・

+ + diff --git a/layout/reftests/bugs/116882-1.html b/layout/reftests/bugs/116882-1.html new file mode 100644 index 000000000000..8af8ad97d2f7 --- /dev/null +++ b/layout/reftests/bugs/116882-1.html @@ -0,0 +1,11 @@ + + + + Shift_JIS illegal sequences + + + +

ŭŝ˙ !"#$%&'()*+,-./0123456789:;<=>?†Ĥ

+ + diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index 9ccf99ccb069..110b107988d6 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -77,6 +77,7 @@ fails == 25888-3r.html 25888-3r-ref.html # bug 25888 == 99850-1d.html 99850-1-ref.html == 105030-1.html 105030-1-ref.html == 109735-1.html 109735-1-ref.html +== 116882-1.html 116882-1-ref.html == 120834-1a.html 120834-1-ref.html == 120834-2a.html 120834-2-ref.html == 120834-2b.html 120834-2-ref.html