blob: 87e5e1196819133a15276c36c808d96bb01b9fa4 (
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
50
51
52
53
54
55
|
---
title: Encoding API
slug: Web/API/Encoding_API
translation_of: Web/API/Encoding_API
---
<p>{{DefaultAPISidebar("Encoding API")}}{{SeeCompatTable}}</p>
<p>O <strong>Encoding API</strong> providência uma mecânismo para tratar textos em vários tipos de {{Glossary("character encoding", "encode de caracteres")}}, incluindo encodes legados non-{{Glossary("UTF-8")}}</p>
<p>A API provém de quatro interfaces: {{domxref("TextDecoder")}}, {{domxref("TextEncoder")}}, {{domxref("TextDecoderStream")}} e {{domxref("TextEncoderStream")}}.</p>
<h2 id="Interfaces">Interfaces</h2>
<div class="index">
<ul>
<li>{{DOMxRef("TextDecoder")}}</li>
<li>{{DOMxRef("TextEncoder")}}</li>
<li>{{DOMxRef("TextDecoderStream")}}</li>
<li>{{DOMxRef("TextEncoderStream")}}</li>
</ul>
</div>
<h2 id="Tutoriais_ferramentas">Tutoriais & ferramentas</h2>
<ul>
<li>O <a href="http://code.google.com/p/stringencoding/" title="http://code.google.com/p/stringencoding/">shim</a> permite usar essa interface em navegadores que não a suportam.</li>
<li><a href="/en-US/Add-ons/Code_snippets/StringView" title="/en-US/docs/Web/JavaScript/Typed_arrays/StringView"><code>StringView</code></a> – Um C-like reperesentação de strings baseados em arrays tipados</li>
</ul>
<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")}}</td>
<td>{{Spec2("Encoding")}}</td>
<td>Definição inicial.</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility">Compatibilidade com navegadores</h2>
<h3 id="TextDecoder"><code>TextDecoder</code></h3>
<p>{{Compat("api.TextDecoder")}}</p>
<h3 id="TextEncoder"><code>TextEncoder</code></h3>
<p>{{Compat("api.TextEncoder")}}</p>
|