diff --git a/dom/encoding/TextDecoder.cpp b/dom/encoding/TextDecoder.cpp index b214799e5aec..120dd7d4ab7e 100644 --- a/dom/encoding/TextDecoder.cpp +++ b/dom/encoding/TextDecoder.cpp @@ -206,6 +206,13 @@ TextDecoder::GetEncoding(nsAString& aEncoding) return; } + // Similarly, "x-windows-949" is used for the "euc-kr" family. Therefore, if + // the internal encoding name is "x-windows-949", "euc-kr" is returned. + if (mEncoding.EqualsLiteral("x-windows-949")) { + aEncoding.AssignLiteral("euc-kr"); + return; + } + CopyASCIItoUTF16(mEncoding, aEncoding); nsContentUtils::ASCIIToLower(aEncoding); } diff --git a/dom/encoding/labelsencodings.properties b/dom/encoding/labelsencodings.properties index 8a67615c7e9e..3ceecdca1ce0 100644 --- a/dom/encoding/labelsencodings.properties +++ b/dom/encoding/labelsencodings.properties @@ -205,16 +205,16 @@ shift_jis=Shift_JIS sjis=Shift_JIS windows-31j=Shift_JIS x-sjis=Shift_JIS -cseuckr=EUC-KR -csksc56011987=EUC-KR -euc-kr=EUC-KR -iso-ir-149=EUC-KR -korean=EUC-KR -ks_c_5601-1987=EUC-KR -ks_c_5601-1989=EUC-KR -ksc5601=EUC-KR -ksc_5601=EUC-KR -windows-949=EUC-KR +cseuckr=x-windows-949 +csksc56011987=x-windows-949 +euc-kr=x-windows-949 +iso-ir-149=x-windows-949 +korean=x-windows-949 +ks_c_5601-1987=x-windows-949 +ks_c_5601-1989=x-windows-949 +ksc5601=x-windows-949 +ksc_5601=x-windows-949 +windows-949=x-windows-949 csiso2022kr=ISO-2022-KR iso-2022-kr=ISO-2022-KR utf-16=UTF-16LE diff --git a/dom/encoding/test/Makefile.in b/dom/encoding/test/Makefile.in index 36f836d0a9b6..f53c00c1f670 100644 --- a/dom/encoding/test/Makefile.in +++ b/dom/encoding/test/Makefile.in @@ -21,6 +21,7 @@ MOCHITEST_FILES = \ test_TextEncoder.html \ test_TextEncoder.js \ test_stringencoding.html \ + test_submit_euckr.html \ $(NULL) MOCHITEST_CHROME_FILES = \ diff --git a/dom/encoding/test/test_submit_euckr.html b/dom/encoding/test/test_submit_euckr.html new file mode 100644 index 000000000000..5a5b3ed82520 --- /dev/null +++ b/dom/encoding/test/test_submit_euckr.html @@ -0,0 +1,34 @@ + + + + + Test for euc-kr encoded form submission + + + + +
+ +
+ +
+ + +