-
Notifications
You must be signed in to change notification settings - Fork 4
/
781.txt
84 lines (60 loc) · 4.07 KB
/
781.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
[21] [CODE(DOMi)@en[Document]] [[インターフェイス]]の
[DFN[[CODE(DOMa)@en[charset][document.charset]]]] [[IDL属性]]、
[DFN[[CODE(DOMa)@en[characterSet][document.characterSet]]]] [[IDL属性]]、
[DFN[[CODE(DOMa)@en[inputEncoding][document.inputEncoding]]]] [[IDL属性]]は、
[[文書]]の[[文字コード]]を表します。
* 仕様書
[REFS[
- [17] [CITE@en[DOM Standard]] ([TIME[2017-04-26 17:06:12 +09:00]]) <https://dom.spec.whatwg.org/#concept-document-encoding>
- [14] [CITE@en[DOM Standard]] ([TIME[2017-04-26 17:06:12 +09:00]]) <https://dom.spec.whatwg.org/#dom-document-charset>
]REFS]
* 文書の文字符号化
[18] [[文書]]は、[DFN[[F[[RUBYB[[[符号化][文書の文字符号化]]]@en[encoding]]]]]]を持ちます
[SRC[>>17]]。値は[[符号化][文字符号化]]です [SRC[>>17]]。
[19] 既定値は [[UTF-8]] です [SRC[>>17]]。 [[navigate]]
などを通じて[[バイト列]]から[[文書]]が作られた時、
[[バイト列]]から[[文字列]]に[[復号][復号 (符号化)]]するために使われた[[符号化][文字符号化]]に設定されます。
[HISTORY[
[20] かつては[DFN[[[文書の[F[文字符号化]]]]]]と呼ばれていました。
]HISTORY]
* 取得器
[15] [CODE(JS)@en[document.characterSet]],
[CODE(JS)@en[document.charset]],
[CODE(JS)@en[document.inputEncoding]]
の[[取得器]]は、次のようにしなければ[MUST[なりません]] [SRC[>>14]]。
[FIG(steps)[
= [16] [[文脈オブジェクト]]の[F[符号化][文書の文字符号化]]の[F[名前][符号化名]]を返します。
]FIG]
* 歴史
[9] [[DOM水準3中核]][[仕様書]]には [CODE(DOMa)@en[inputEncoding]]
の定義がありましたが、[[値域]]が明記されていませんでした。
[5] [CODE(JS)@en[[[document.characterSet]]]] 特性を
[[Gecko]]、[[WebKit]]、[[Opera]] は実装していますが、 [[WinIE8]] は実装していません。
[TIME[2011-02-27T02:45:54.000Z]]
[6] [[Gecko]] と [[WebKit]] には [[setter]] がありませんが、 [[Opera]]
にはあります。
[1]
[CITE[Bug 380383 – '''['''FIX''']'''about:blank encoding is not consistent]] ([TIME[2008-05-24 20:19:20 +09:00]] 版) <https://bugzilla.mozilla.org/show_bug.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&id=380383>
[3]
[CODE(JS)@en[[[document.charset]]]] 特性を
[[WinIE]]、[[Opera]]、[[WebKit]] は実装していますが、 [[Gecko]] は実装していません。
[TIME[2011-02-27T02:41:48.00Z]]
[4] [[WinIE8]] は [[setter]] を実装していません。
[2] [CITE[Index of /~wakaba/-temp/test/dom/document/meta]] ([TIME[2011-02-27 11:39:34 +09:00]] 版) <http://suika.fam.cx/~wakaba/-temp/test/dom/document/meta/>
[7] [CITE[IRC logs: freenode / #whatwg / 20130822]]
( ([TIME[2013-08-25 00:37:43 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20130822>
[8] [CITE[IRC logs: freenode / #whatwg / 20130828]]
( ([TIME[2013-09-04 20:49:29 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20130828#l-102>
[10] [CITE@en[Define compatibility names for encodings and document.inputEncoding · 03e1703 · whatwg/dom]] ([TIME[2014-11-30 17:18:16 +09:00]] 版) <https://github.com/whatwg/dom/commit/03e170351f095e4fe749e0259a3aafc0cbb49c91>
[11] [CITE@en[Add Document.prototype.charset as legacy alias of characterSet · whatwg/dom@6941936]] ([TIME[2015-10-07 20:37:50 +09:00]] 版) <https://github.com/whatwg/dom/commit/6941936bd06438f84ad91d131e2e89ab0f1f7a45>
[12] [CITE@en[Fix #32: use the encoding name exposed by DOM and HTML <form> · whatwg/encoding@18bf4fa]]
([TIME[2016-02-11 11:49:28 +09:00]] 版)
<https://github.com/whatwg/encoding/commit/18bf4fa6f005a899696800a8f6b0d20f3a4c1c0e>
[13] [CITE@en[Let the Encoding Standard deal with the canonical name · whatwg/dom@2bf4e62]]
([TIME[2016-02-11 11:53:19 +09:00]] 版)
<https://github.com/whatwg/dom/commit/2bf4e6273af4da39113dc27fa23dbd447329ec31>
[22] [CITE@en[Require UTF-8]]
([[sideshowbarker]]著, [TIME[2017-10-06 19:09:17 +09:00]])
<https://github.com/whatwg/html/commit/fae77e3c558b9f083dfb9086752863a4789268f5>