Log Message
Align KOI8-U and ibm866 encodings with Chrome, Firefox, and the specification https://bugs.webkit.org/show_bug.cgi?id=216184
Reviewed by Darin Adler. LayoutTests/imported/w3c: * web-platform-tests/encoding/single-byte-decoder-expected.txt: Source/WebCore: Covered by newly passing web platform tests. * platform/text/TextCodecICU.cpp: * platform/text/TextCodecSingleByte.cpp: (WebCore::tableForEncoding): (WebCore::tableForDecoding): (WebCore::TextCodecSingleByte::registerEncodingNames): (WebCore::TextCodecSingleByte::registerCodecs): * platform/text/TextCodecSingleByte.h:
Modified Paths
- trunk/LayoutTests/imported/w3c/ChangeLog
- trunk/LayoutTests/imported/w3c/web-platform-tests/encoding/single-byte-decoder-expected.txt
- trunk/Source/WebCore/ChangeLog
- trunk/Source/WebCore/platform/text/TextCodecICU.cpp
- trunk/Source/WebCore/platform/text/TextCodecSingleByte.cpp
- trunk/Source/WebCore/platform/text/TextCodecSingleByte.h
Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (266650 => 266651)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2020-09-05 01:05:39 UTC (rev 266650)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2020-09-05 02:51:05 UTC (rev 266651)
@@ -1,3 +1,12 @@
+2020-09-04 Alex Christensen <[email protected]>
+
+ Align KOI8-U and ibm866 encodings with Chrome, Firefox, and the specification
+ https://bugs.webkit.org/show_bug.cgi?id=216184
+
+ Reviewed by Darin Adler.
+
+ * web-platform-tests/encoding/single-byte-decoder-expected.txt:
+
2020-09-04 Chris Dumez <[email protected]>
Improve interpolation algorithm in OscillatorNode
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/encoding/single-byte-decoder-expected.txt (266650 => 266651)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/encoding/single-byte-decoder-expected.txt 2020-09-05 01:05:39 UTC (rev 266650)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/encoding/single-byte-decoder-expected.txt 2020-09-05 02:51:05 UTC (rev 266651)
@@ -1,15 +1,15 @@
-FAIL IBM866: 866 (XMLHttpRequest) assert_equals: IBM866:26 expected 26 but got 28
-FAIL IBM866: 866 (TextDecoder) assert_equals: IBM866:26 expected 26 but got 28
+PASS IBM866: 866 (XMLHttpRequest)
+PASS IBM866: 866 (TextDecoder)
PASS IBM866: 866 (document.characterSet and document.inputEncoding)
-FAIL IBM866: cp866 (XMLHttpRequest) assert_equals: IBM866:26 expected 26 but got 28
-FAIL IBM866: cp866 (TextDecoder) assert_equals: IBM866:26 expected 26 but got 28
+PASS IBM866: cp866 (XMLHttpRequest)
+PASS IBM866: cp866 (TextDecoder)
PASS IBM866: cp866 (document.characterSet and document.inputEncoding)
-FAIL IBM866: csibm866 (XMLHttpRequest) assert_equals: IBM866:26 expected 26 but got 28
-FAIL IBM866: csibm866 (TextDecoder) assert_equals: IBM866:26 expected 26 but got 28
+PASS IBM866: csibm866 (XMLHttpRequest)
+PASS IBM866: csibm866 (TextDecoder)
PASS IBM866: csibm866 (document.characterSet and document.inputEncoding)
-FAIL IBM866: ibm866 (XMLHttpRequest) assert_equals: IBM866:26 expected 26 but got 28
-FAIL IBM866: ibm866 (TextDecoder) assert_equals: IBM866:26 expected 26 but got 28
+PASS IBM866: ibm866 (XMLHttpRequest)
+PASS IBM866: ibm866 (TextDecoder)
PASS IBM866: ibm866 (document.characterSet and document.inputEncoding)
PASS ISO-8859-2: csisolatin2 (XMLHttpRequest)
PASS ISO-8859-2: csisolatin2 (TextDecoder)
@@ -311,11 +311,11 @@
PASS KOI8-R: koi8_r (XMLHttpRequest)
PASS KOI8-R: koi8_r (TextDecoder)
PASS KOI8-R: koi8_r (document.characterSet and document.inputEncoding)
-FAIL KOI8-U: koi8-ru (XMLHttpRequest) assert_equals: KOI8-U:174 expected 1118 but got 9565
-FAIL KOI8-U: koi8-ru (TextDecoder) assert_equals: KOI8-U:174 expected 1118 but got 9565
+PASS KOI8-U: koi8-ru (XMLHttpRequest)
+PASS KOI8-U: koi8-ru (TextDecoder)
PASS KOI8-U: koi8-ru (document.characterSet and document.inputEncoding)
-FAIL KOI8-U: koi8-u (XMLHttpRequest) assert_equals: KOI8-U:174 expected 1118 but got 9565
-FAIL KOI8-U: koi8-u (TextDecoder) assert_equals: KOI8-U:174 expected 1118 but got 9565
+PASS KOI8-U: koi8-u (XMLHttpRequest)
+PASS KOI8-U: koi8-u (TextDecoder)
PASS KOI8-U: koi8-u (document.characterSet and document.inputEncoding)
PASS macintosh: csmacintosh (XMLHttpRequest)
PASS macintosh: csmacintosh (TextDecoder)
Modified: trunk/Source/WebCore/ChangeLog (266650 => 266651)
--- trunk/Source/WebCore/ChangeLog 2020-09-05 01:05:39 UTC (rev 266650)
+++ trunk/Source/WebCore/ChangeLog 2020-09-05 02:51:05 UTC (rev 266651)
@@ -1,3 +1,20 @@
+2020-09-04 Alex Christensen <[email protected]>
+
+ Align KOI8-U and ibm866 encodings with Chrome, Firefox, and the specification
+ https://bugs.webkit.org/show_bug.cgi?id=216184
+
+ Reviewed by Darin Adler.
+
+ Covered by newly passing web platform tests.
+
+ * platform/text/TextCodecICU.cpp:
+ * platform/text/TextCodecSingleByte.cpp:
+ (WebCore::tableForEncoding):
+ (WebCore::tableForDecoding):
+ (WebCore::TextCodecSingleByte::registerEncodingNames):
+ (WebCore::TextCodecSingleByte::registerCodecs):
+ * platform/text/TextCodecSingleByte.h:
+
2020-09-04 Sam Weinig <[email protected]>
[WebIDL] Adopt LegacyFactoryFunction extended attribute in lieu of NamedConstructor
Modified: trunk/Source/WebCore/platform/text/TextCodecICU.cpp (266650 => 266651)
--- trunk/Source/WebCore/platform/text/TextCodecICU.cpp 2020-09-05 01:05:39 UTC (rev 266650)
+++ trunk/Source/WebCore/platform/text/TextCodecICU.cpp 2020-09-05 02:51:05 UTC (rev 266651)
@@ -46,7 +46,6 @@
static const char* const encoding##_aliases[] { __VA_ARGS__ }
// From https://encoding.spec.whatwg.org. Plus a few extra aliases that macOS had historically from TEC.
-DECLARE_ALIASES(IBM866, "866", "cp866", "csibm866");
DECLARE_ALIASES(ISO_8859_2, "csisolatin2", "iso-ir-101", "iso8859-2", "iso88592", "iso_8859-2", "iso_8859-2:1987", "l2", "latin2");
DECLARE_ALIASES(ISO_8859_4, "csisolatin4", "iso-ir-110", "iso8859-4", "iso88594", "iso_8859-4", "iso_8859-4:1988", "l4", "latin4");
DECLARE_ALIASES(ISO_8859_5, "csisolatincyrillic", "cyrillic", "iso-ir-144", "iso8859-5", "iso88595", "iso_8859-5", "iso_8859-5:1988");
@@ -56,7 +55,6 @@
DECLARE_ALIASES(ISO_8859_15, "csisolatin9", "iso8859-15", "iso885915", "iso_8859-15", "l9");
DECLARE_ALIASES(ISO_8859_16, "isoir226", "iso8859162001", "l10", "latin10");
DECLARE_ALIASES(KOI8_R, "cskoi8r", "koi", "koi8", "koi8_r");
-DECLARE_ALIASES(KOI8_U, "koi8-ru");
DECLARE_ALIASES(macintosh, "csmacintosh", "mac", "x-mac-roman", "macroman", "x-macroman");
DECLARE_ALIASES(windows_1250, "cp1250", "x-cp1250", "winlatin2");
DECLARE_ALIASES(windows_1251, "cp1251", "wincyrillic", "x-cp1251");
@@ -82,7 +80,6 @@
unsigned aliasCount;
const char* const * aliases;
} encodingNames[] = {
- DECLARE_ENCODING_NAME("IBM866", IBM866),
DECLARE_ENCODING_NAME("ISO-8859-2", ISO_8859_2),
DECLARE_ENCODING_NAME("ISO-8859-4", ISO_8859_4),
DECLARE_ENCODING_NAME("ISO-8859-5", ISO_8859_5),
@@ -92,7 +89,6 @@
DECLARE_ENCODING_NAME("ISO-8859-15", ISO_8859_15),
DECLARE_ENCODING_NAME("ISO-8859-16", ISO_8859_16),
DECLARE_ENCODING_NAME("KOI8-R", KOI8_R),
- DECLARE_ENCODING_NAME("KOI8-U", KOI8_U),
DECLARE_ENCODING_NAME("macintosh", macintosh),
DECLARE_ENCODING_NAME("windows-1250", windows_1250),
DECLARE_ENCODING_NAME("windows-1251", windows_1251),
Modified: trunk/Source/WebCore/platform/text/TextCodecSingleByte.cpp (266650 => 266651)
--- trunk/Source/WebCore/platform/text/TextCodecSingleByte.cpp 2020-09-05 01:05:39 UTC (rev 266650)
+++ trunk/Source/WebCore/platform/text/TextCodecSingleByte.cpp 2020-09-05 02:51:05 UTC (rev 266651)
@@ -127,6 +127,30 @@
0x0161, 0x0144, 0x0146, 0x00F3, 0x014D, 0x00F5, 0x00F6, 0x00F7, 0x0173, 0x0142, 0x015B, 0x016B, 0x00FC, 0x017C, 0x017E, 0x02D9
};
+// From https://encoding.spec.whatwg.org/index-koi8-u.txt
+constexpr UChar koi8u[128] {
+ 0x2500, 0x2502, 0x250C, 0x2510, 0x2514, 0x2518, 0x251C, 0x2524, 0x252C, 0x2534, 0x253C, 0x2580, 0x2584, 0x2588, 0x258C, 0x2590,
+ 0x2591, 0x2592, 0x2593, 0x2320, 0x25A0, 0x2219, 0x221A, 0x2248, 0x2264, 0x2265, 0x00A0, 0x2321, 0x00B0, 0x00B2, 0x00B7, 0x00F7,
+ 0x2550, 0x2551, 0x2552, 0x0451, 0x0454, 0x2554, 0x0456, 0x0457, 0x2557, 0x2558, 0x2559, 0x255A, 0x255B, 0x0491, 0x045E, 0x255E,
+ 0x255F, 0x2560, 0x2561, 0x0401, 0x0404, 0x2563, 0x0406, 0x0407, 0x2566, 0x2567, 0x2568, 0x2569, 0x256A, 0x0490, 0x040E, 0x00A9,
+ 0x044E, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433, 0x0445, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E,
+ 0x043F, 0x044F, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, 0x044C, 0x044B, 0x0437, 0x0448, 0x044D, 0x0449, 0x0447, 0x044A,
+ 0x042E, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, 0x0425, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E,
+ 0x041F, 0x042F, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, 0x042C, 0x042B, 0x0417, 0x0428, 0x042D, 0x0429, 0x0427, 0x042A
+};
+
+// From https://encoding.spec.whatwg.org/index-ibm866.txt
+constexpr UChar ibm866[128] {
+ 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F,
+ 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F,
+ 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F,
+ 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510,
+ 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567,
+ 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580,
+ 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F,
+ 0x0401, 0x0451, 0x0404, 0x0454, 0x0407, 0x0457, 0x040E, 0x045E, 0x00B0, 0x2219, 0x00B7, 0x221A, 0x2116, 0x00A4, 0x25A0, 0x00A0
+};
+
template<const UChar* decodeTable>
std::pair<const std::pair<UChar, uint8_t>*, size_t> tableForEncoding()
{
@@ -170,6 +194,10 @@
return tableForEncoding<windows1255>();
case TextCodecSingleByte::Encoding::Windows_1257:
return tableForEncoding<windows1257>();
+ case TextCodecSingleByte::Encoding::IBM866:
+ return tableForEncoding<ibm866>();
+ case TextCodecSingleByte::Encoding::KOI8U:
+ return tableForEncoding<koi8u>();
}
ASSERT_NOT_REACHED();
return { nullptr, 0 };
@@ -194,6 +222,10 @@
return windows1255;
case TextCodecSingleByte::Encoding::Windows_1257:
return windows1257;
+ case TextCodecSingleByte::Encoding::IBM866:
+ return ibm866;
+ case TextCodecSingleByte::Encoding::KOI8U:
+ return koi8u;
}
ASSERT_NOT_REACHED();
return nullptr;
@@ -371,6 +403,18 @@
"cp1257",
"x-cp1257"
});
+
+ registerAliases({
+ "KOI8-U",
+ "koi8-ru"
+ });
+
+ registerAliases({
+ "IBM866",
+ "866",
+ "cp866",
+ "csibm866"
+ });
}
void TextCodecSingleByte::registerCodecs(TextCodecRegistrar registrar)
@@ -402,6 +446,12 @@
registrar("windows-1257", [] {
return makeUnique<TextCodecSingleByte>(Encoding::Windows_1257);
});
+ registrar("KOI8-U", [] {
+ return makeUnique<TextCodecSingleByte>(Encoding::KOI8U);
+ });
+ registrar("IBM866", [] {
+ return makeUnique<TextCodecSingleByte>(Encoding::IBM866);
+ });
}
}
Modified: trunk/Source/WebCore/platform/text/TextCodecSingleByte.h (266650 => 266651)
--- trunk/Source/WebCore/platform/text/TextCodecSingleByte.h 2020-09-05 01:05:39 UTC (rev 266650)
+++ trunk/Source/WebCore/platform/text/TextCodecSingleByte.h 2020-09-05 02:51:05 UTC (rev 266651)
@@ -39,7 +39,9 @@
Windows_874,
Windows_1253,
Windows_1255,
- Windows_1257
+ Windows_1257,
+ IBM866,
+ KOI8U,
};
explicit TextCodecSingleByte(Encoding);
_______________________________________________ webkit-changes mailing list [email protected] https://lists.webkit.org/mailman/listinfo/webkit-changes
