aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/textencoder/encoding/index.html
blob: 602a16c5ff4e2a3a911f802c13139b1d0f426c2e (plain)
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
---
title: TextEncoder.encoding
slug: Web/API/TextEncoder/encoding
translation_of: Web/API/TextEncoder/encoding
---
<p>{{APIRef("DOM")}}</p>

<p>{{ SeeCompatTable }}</p>

<p><strong><code>TextEncoder.encoding</code></strong> 只读属性返回一个{{domxref("DOMString")}} ,其中包含特定编码器使用的编码算法的名称。</p>

<p>现在只会返回“utf-8”。</p>

<h2 id="语法">语法</h2>

<pre class="syntaxbox"><em>b</em> = <em>encoder</em>.encoding;</pre>

<h2 id="标准">标准</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('Encoding', '#dom-textencoder-encoding', 'TextEncoder.encoding')}}</td>
   <td>{{Spec2('Encoding')}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>

<h2 id="浏览器支持">浏览器支持</h2>

<div>
<div>


<p>{{Compat("api.TextEncoder.encoding")}}</p>
</div>
</div>

<h2 id="另见">另见</h2>

<ul>
 <li>The {{domxref("TextEncoder")}} interface it belongs to.</li>
</ul>