Changeset 266651 in webkit
- Timestamp:
- Sep 4, 2020 7:51:05 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r266627 r266651 1 2020-09-04 Alex Christensen <achristensen@webkit.org> 2 3 Align KOI8-U and ibm866 encodings with Chrome, Firefox, and the specification 4 https://bugs.webkit.org/show_bug.cgi?id=216184 5 6 Reviewed by Darin Adler. 7 8 * web-platform-tests/encoding/single-byte-decoder-expected.txt: 9 1 10 2020-09-04 Chris Dumez <cdumez@apple.com> 2 11 -
trunk/LayoutTests/imported/w3c/web-platform-tests/encoding/single-byte-decoder-expected.txt
r266527 r266651 1 1 2 FAIL IBM866: 866 (XMLHttpRequest) assert_equals: IBM866:26 expected 26 but got 28 3 FAIL IBM866: 866 (TextDecoder) assert_equals: IBM866:26 expected 26 but got 28 2 PASS IBM866: 866 (XMLHttpRequest) 3 PASS IBM866: 866 (TextDecoder) 4 4 PASS IBM866: 866 (document.characterSet and document.inputEncoding) 5 FAIL IBM866: cp866 (XMLHttpRequest) assert_equals: IBM866:26 expected 26 but got 28 6 FAIL IBM866: cp866 (TextDecoder) assert_equals: IBM866:26 expected 26 but got 28 5 PASS IBM866: cp866 (XMLHttpRequest) 6 PASS IBM866: cp866 (TextDecoder) 7 7 PASS IBM866: cp866 (document.characterSet and document.inputEncoding) 8 FAIL IBM866: csibm866 (XMLHttpRequest) assert_equals: IBM866:26 expected 26 but got 28 9 FAIL IBM866: csibm866 (TextDecoder) assert_equals: IBM866:26 expected 26 but got 28 8 PASS IBM866: csibm866 (XMLHttpRequest) 9 PASS IBM866: csibm866 (TextDecoder) 10 10 PASS IBM866: csibm866 (document.characterSet and document.inputEncoding) 11 FAIL IBM866: ibm866 (XMLHttpRequest) assert_equals: IBM866:26 expected 26 but got 28 12 FAIL IBM866: ibm866 (TextDecoder) assert_equals: IBM866:26 expected 26 but got 28 11 PASS IBM866: ibm866 (XMLHttpRequest) 12 PASS IBM866: ibm866 (TextDecoder) 13 13 PASS IBM866: ibm866 (document.characterSet and document.inputEncoding) 14 14 PASS ISO-8859-2: csisolatin2 (XMLHttpRequest) … … 312 312 PASS KOI8-R: koi8_r (TextDecoder) 313 313 PASS KOI8-R: koi8_r (document.characterSet and document.inputEncoding) 314 FAIL KOI8-U: koi8-ru (XMLHttpRequest) assert_equals: KOI8-U:174 expected 1118 but got 9565 315 FAIL KOI8-U: koi8-ru (TextDecoder) assert_equals: KOI8-U:174 expected 1118 but got 9565 314 PASS KOI8-U: koi8-ru (XMLHttpRequest) 315 PASS KOI8-U: koi8-ru (TextDecoder) 316 316 PASS KOI8-U: koi8-ru (document.characterSet and document.inputEncoding) 317 FAIL KOI8-U: koi8-u (XMLHttpRequest) assert_equals: KOI8-U:174 expected 1118 but got 9565 318 FAIL KOI8-U: koi8-u (TextDecoder) assert_equals: KOI8-U:174 expected 1118 but got 9565 317 PASS KOI8-U: koi8-u (XMLHttpRequest) 318 PASS KOI8-U: koi8-u (TextDecoder) 319 319 PASS KOI8-U: koi8-u (document.characterSet and document.inputEncoding) 320 320 PASS macintosh: csmacintosh (XMLHttpRequest) -
trunk/Source/WebCore/ChangeLog
r266649 r266651 1 2020-09-04 Alex Christensen <achristensen@webkit.org> 2 3 Align KOI8-U and ibm866 encodings with Chrome, Firefox, and the specification 4 https://bugs.webkit.org/show_bug.cgi?id=216184 5 6 Reviewed by Darin Adler. 7 8 Covered by newly passing web platform tests. 9 10 * platform/text/TextCodecICU.cpp: 11 * platform/text/TextCodecSingleByte.cpp: 12 (WebCore::tableForEncoding): 13 (WebCore::tableForDecoding): 14 (WebCore::TextCodecSingleByte::registerEncodingNames): 15 (WebCore::TextCodecSingleByte::registerCodecs): 16 * platform/text/TextCodecSingleByte.h: 17 1 18 2020-09-04 Sam Weinig <weinig@apple.com> 2 19 -
trunk/Source/WebCore/platform/text/TextCodecICU.cpp
r266527 r266651 47 47 48 48 // From https://encoding.spec.whatwg.org. Plus a few extra aliases that macOS had historically from TEC. 49 DECLARE_ALIASES(IBM866, "866", "cp866", "csibm866");50 49 DECLARE_ALIASES(ISO_8859_2, "csisolatin2", "iso-ir-101", "iso8859-2", "iso88592", "iso_8859-2", "iso_8859-2:1987", "l2", "latin2"); 51 50 DECLARE_ALIASES(ISO_8859_4, "csisolatin4", "iso-ir-110", "iso8859-4", "iso88594", "iso_8859-4", "iso_8859-4:1988", "l4", "latin4"); … … 57 56 DECLARE_ALIASES(ISO_8859_16, "isoir226", "iso8859162001", "l10", "latin10"); 58 57 DECLARE_ALIASES(KOI8_R, "cskoi8r", "koi", "koi8", "koi8_r"); 59 DECLARE_ALIASES(KOI8_U, "koi8-ru");60 58 DECLARE_ALIASES(macintosh, "csmacintosh", "mac", "x-mac-roman", "macroman", "x-macroman"); 61 59 DECLARE_ALIASES(windows_1250, "cp1250", "x-cp1250", "winlatin2"); … … 83 81 const char* const * aliases; 84 82 } encodingNames[] = { 85 DECLARE_ENCODING_NAME("IBM866", IBM866),86 83 DECLARE_ENCODING_NAME("ISO-8859-2", ISO_8859_2), 87 84 DECLARE_ENCODING_NAME("ISO-8859-4", ISO_8859_4), … … 93 90 DECLARE_ENCODING_NAME("ISO-8859-16", ISO_8859_16), 94 91 DECLARE_ENCODING_NAME("KOI8-R", KOI8_R), 95 DECLARE_ENCODING_NAME("KOI8-U", KOI8_U),96 92 DECLARE_ENCODING_NAME("macintosh", macintosh), 97 93 DECLARE_ENCODING_NAME("windows-1250", windows_1250), -
trunk/Source/WebCore/platform/text/TextCodecSingleByte.cpp
r266527 r266651 128 128 }; 129 129 130 // From https://encoding.spec.whatwg.org/index-koi8-u.txt 131 constexpr UChar koi8u[128] { 132 0x2500, 0x2502, 0x250C, 0x2510, 0x2514, 0x2518, 0x251C, 0x2524, 0x252C, 0x2534, 0x253C, 0x2580, 0x2584, 0x2588, 0x258C, 0x2590, 133 0x2591, 0x2592, 0x2593, 0x2320, 0x25A0, 0x2219, 0x221A, 0x2248, 0x2264, 0x2265, 0x00A0, 0x2321, 0x00B0, 0x00B2, 0x00B7, 0x00F7, 134 0x2550, 0x2551, 0x2552, 0x0451, 0x0454, 0x2554, 0x0456, 0x0457, 0x2557, 0x2558, 0x2559, 0x255A, 0x255B, 0x0491, 0x045E, 0x255E, 135 0x255F, 0x2560, 0x2561, 0x0401, 0x0404, 0x2563, 0x0406, 0x0407, 0x2566, 0x2567, 0x2568, 0x2569, 0x256A, 0x0490, 0x040E, 0x00A9, 136 0x044E, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433, 0x0445, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 137 0x043F, 0x044F, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, 0x044C, 0x044B, 0x0437, 0x0448, 0x044D, 0x0449, 0x0447, 0x044A, 138 0x042E, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, 0x0425, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 139 0x041F, 0x042F, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, 0x042C, 0x042B, 0x0417, 0x0428, 0x042D, 0x0429, 0x0427, 0x042A 140 }; 141 142 // From https://encoding.spec.whatwg.org/index-ibm866.txt 143 constexpr UChar ibm866[128] { 144 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F, 145 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F, 146 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, 147 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510, 148 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567, 149 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580, 150 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, 151 0x0401, 0x0451, 0x0404, 0x0454, 0x0407, 0x0457, 0x040E, 0x045E, 0x00B0, 0x2219, 0x00B7, 0x221A, 0x2116, 0x00A4, 0x25A0, 0x00A0 152 }; 153 130 154 template<const UChar* decodeTable> 131 155 std::pair<const std::pair<UChar, uint8_t>*, size_t> tableForEncoding() … … 171 195 case TextCodecSingleByte::Encoding::Windows_1257: 172 196 return tableForEncoding<windows1257>(); 197 case TextCodecSingleByte::Encoding::IBM866: 198 return tableForEncoding<ibm866>(); 199 case TextCodecSingleByte::Encoding::KOI8U: 200 return tableForEncoding<koi8u>(); 173 201 } 174 202 ASSERT_NOT_REACHED(); … … 195 223 case TextCodecSingleByte::Encoding::Windows_1257: 196 224 return windows1257; 225 case TextCodecSingleByte::Encoding::IBM866: 226 return ibm866; 227 case TextCodecSingleByte::Encoding::KOI8U: 228 return koi8u; 197 229 } 198 230 ASSERT_NOT_REACHED(); … … 372 404 "x-cp1257" 373 405 }); 406 407 registerAliases({ 408 "KOI8-U", 409 "koi8-ru" 410 }); 411 412 registerAliases({ 413 "IBM866", 414 "866", 415 "cp866", 416 "csibm866" 417 }); 374 418 } 375 419 … … 403 447 return makeUnique<TextCodecSingleByte>(Encoding::Windows_1257); 404 448 }); 405 } 406 407 } 449 registrar("KOI8-U", [] { 450 return makeUnique<TextCodecSingleByte>(Encoding::KOI8U); 451 }); 452 registrar("IBM866", [] { 453 return makeUnique<TextCodecSingleByte>(Encoding::IBM866); 454 }); 455 } 456 457 } -
trunk/Source/WebCore/platform/text/TextCodecSingleByte.h
r266527 r266651 40 40 Windows_1253, 41 41 Windows_1255, 42 Windows_1257 42 Windows_1257, 43 IBM866, 44 KOI8U, 43 45 }; 44 46
Note: See TracChangeset
for help on using the changeset viewer.