change the encoding

HTML における文字コード

仕様書

概念

charset 引数

[21] charset 引数は、 sniffed MIME type ではなく、 元々の MIME型の指定から得ます >>20

テストケース

[31] HTML documents misinterpreted by charset sniffer

歴史

[1] Web Applications 1.0 r7544 More detail on the inheritance of encodings from parent browsing contexts. ( ( 版)) http://html5.org/tools/web-apps-tracker?from=7543&to=7544

[2] Web Applications 1.0 r7958 New encoding defaults based on more data. ( ( 版)) http://html5.org/tools/web-apps-tracker?from=7957&to=7958

[3] Web Applications 1.0 r8073 Provide a hook for XHR and web components to incrementally decode with a known encoding ( ( 版)) http://html5.org/tools/web-apps-tracker?from=8072&to=8073

[4] Web Applications 1.0 r8258 Add some more locales to the default encoding logic. ( ( 版)) http://html5.org/tools/web-apps-tracker?from=8257&to=8258

[5] Web Applications 1.0 r8259 Add greek to the default encoding logic. ( ( 版)) http://html5.org/tools/web-apps-tracker?from=8258&to=8259

[6] Attachment #8336745 for bug #910211 ( ( 版)) https://bugzilla.mozilla.org/attachment.cgi?id=8336745&action=diff#a/dom/encoding/domainsfallbacks.properties_sec2

[7] IRC logs: freenode / #whatwg / 20131127 ( ( 版)) http://krijnhoetmer.nl/irc-logs/whatwg/20131127#l-273

[8] [whatwg] Guessing the fallback encoding from the top-level domain name before trying to guess from the browser localization ( ( 版)) http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2013-December/041819.html

[9] Bug 126375 – Consider using top-level domain name for encoding sniffing ( ( 版)) https://bugs.webkit.org/show_bug.cgi?id=126375

[10] Web Applications 1.0 r8512 Adjust some internal comments regarding encodings ( ( 版)) http://html5.org/tools/web-apps-tracker?from=8511&to=8512

[11] 815551 – Autodetect UTF-8 by default ( ( 版)) https://bugzilla.mozilla.org/show_bug.cgi?id=815551

[12] Bug 25534 – HTML spec should not encourage to auto-detect UTF-8 ( ( 版)) https://www.w3.org/Bugs/Public/show_bug.cgi?id=25534#c1

実装

[16] テストケース (>>15) によると ()、

[23] Chrome では、利用者が手動で文字コードを指定すると、 以後そのタブでは (著者による明示的な指定があっても無視して) その指定に従うようです。他のタブには伝播しません。 起源の違いにも左右されないように見えます。

関連

[13] Encoding Standard, 参照処理モデル, XMLにおける文字コード, MIME charset も参照してください。

[22] IRC logs: freenode / #whatwg / 20150803 ( 版) http://krijnhoetmer.nl/irc-logs/whatwg/20150803

# [17:23] <hsivonen> SimonSapin: I can't recall why I implemented the late <meta> thing in the new parser

# [17:23] <hsivonen> SimonSapin: initially, I make the detectors see at most 1024 bytes so that they couldn't trigger a reload

# [17:23] <hsivonen> SimonSapin: but that broke Japanese Planet Debian

# [17:24] <hsivonen> SimonSapin: and people get really nervous if you break a Japanese site

[24] Let the Encoding standard deal with the BOM · whatwg/html@83ebb72 ( 版) https://github.com/whatwg/html/commit/83ebb728198801e2f1a32b80ec7d7a2e7dccc593

[29] >>24 の変更により、利用者の指示や XHR の指示などによる上書きよりも BOM が最優先されるようになりました。また、 BOM があると confidencecertain に設定されていたのがなくなったので、 BOM があっても他の指定が優先されたり、符号化の変更が実行されたりするようになりました (もっとも結局 BOM が最優先されるので、最終的な結果は変わりません)。

[25] Update integration with Encoding Standard · whatwg/html@6a31c26 ( 版) https://github.com/whatwg/html/commit/6a31c26cf12e39dab1a488e75dd56c03d6786d39

[26] Regression: do not use "get an output encoding" for decoding · whatwg/html@c36f738 ( 版) https://github.com/whatwg/html/commit/c36f7384f1f617b13c68d28b89d850cb18ceadfb

[27] 1280556 – Encoding detection mismatch on http://www.idpf.org/epub/pgt/ () https://bugzilla.mozilla.org/show_bug.cgi?id=1280556

[28] google/compact_enc_det: compact_enc_det - Compact Encoding Detection () https://github.com/google/compact_enc_det

[30] Require UTF-8 (sideshowbarker著, ) https://github.com/whatwg/html/commit/fae77e3c558b9f083dfb9086752863a4789268f5

[32] Give browsing context an explicit container (annevk, , ) https://github.com/whatwg/html/commit/7b4964ad0a953b05738afc66600fa47a4dc8045d