diff --git a/dom/encoding/encodingsgroups.properties b/dom/encoding/encodingsgroups.properties index 17f876f4a6b0..79f8fe5d0ddb 100644 --- a/dom/encoding/encodingsgroups.properties +++ b/dom/encoding/encodingsgroups.properties @@ -5,7 +5,6 @@ # x-unicode is assumed for encodings not listed here Big5=zh-TW -Big5-HKSCS=zh=HK EUC-JP=ja EUC-KR=ko gb18030=zh-CN diff --git a/intl/uconv/moz.build b/intl/uconv/moz.build index ec24b5587478..c2bc8d249473 100644 --- a/intl/uconv/moz.build +++ b/intl/uconv/moz.build @@ -27,7 +27,6 @@ EXPORTS += [ 'ucvja/nsUCVJACID.h', 'ucvko/nsUCvKOCID.h', 'ucvlatin/nsUCvLatinCID.h', - 'ucvtw/nsUCvTWCID.h', ] UNIFIED_SOURCES += [ @@ -137,6 +136,7 @@ UNIFIED_SOURCES += [ ] UNIFIED_SOURCES += [ + 'ucvtw/nsBIG5Data.cpp', 'ucvtw/nsBIG5ToUnicode.cpp', 'ucvtw/nsUnicodeToBIG5.cpp', ] diff --git a/intl/uconv/nsIUnicodeEncoder.h b/intl/uconv/nsIUnicodeEncoder.h index cc3acfcd3ab5..9e35cdf53712 100644 --- a/intl/uconv/nsIUnicodeEncoder.h +++ b/intl/uconv/nsIUnicodeEncoder.h @@ -96,6 +96,12 @@ public: * the first of a surrogate pair. * NS_ERROR_UENC_NOMAPPING if character without mapping * was encountered and the behavior was set to "signal". + * In the case of an unmappable BMP character, aDestLength + * must indicate that the unmappable character was + * consumed by the encoder (unlike in the decode API!). + * In the case of an unmappable astral character, + * aDestLength must indicate that the high surrogate was + * consumed by the encoder but the low surrogate was not. */ NS_IMETHOD Convert(const char16_t * aSrc, int32_t * aSrcLength, char * aDest, int32_t * aDestLength) = 0; diff --git a/intl/uconv/nsUConvModule.cpp b/intl/uconv/nsUConvModule.cpp index a252865e5a38..98ec9772b2ef 100644 --- a/intl/uconv/nsUConvModule.cpp +++ b/intl/uconv/nsUConvModule.cpp @@ -107,8 +107,6 @@ #include "nsUnicodeToISO2022JP.h" // ucvtw -#include "nsUCvTWCID.h" -#include "nsUCvTWDll.h" #include "nsBIG5ToUnicode.h" #include "nsUnicodeToBIG5.h" @@ -212,6 +210,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToISO2022JP) // ucvtw NS_GENERIC_FACTORY_CONSTRUCTOR(nsBIG5ToUnicode) +NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToBIG5) // ucvko @@ -245,11 +244,6 @@ const uint16_t g_ASCIIMappingTable[] = { 0x0001, 0x0004, 0x0005, 0x0008, 0x0000, 0x0000, 0x007F, 0x0000 }; -// ucvtw -const uint16_t g_ufBig5Mapping[] = { -#include "big5.uf" -}; - // ucvko const uint16_t g_utKSC5601Mapping[] = { #include "u20kscgl.ut" diff --git a/intl/uconv/tests/mochitest.ini b/intl/uconv/tests/mochitest.ini index ca1382c3f24e..51ded9433ce9 100644 --- a/intl/uconv/tests/mochitest.ini +++ b/intl/uconv/tests/mochitest.ini @@ -12,3 +12,4 @@ skip-if = toolkit == 'android' #bug 775227 [test_unicode_noncharacters_gb18030.html] [test_unicode_noncharacters_utf8.html] [test_utf8_overconsumption.html] +[test_big5_encoder.html] diff --git a/intl/uconv/tests/test_big5_encoder.html b/intl/uconv/tests/test_big5_encoder.html new file mode 100644 index 000000000000..33970d01017f --- /dev/null +++ b/intl/uconv/tests/test_big5_encoder.html @@ -0,0 +1,43 @@ + + + + + + Test for Unicode non-characters + + + + +
+
+
+Mozilla Bug 912470 +

+