aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/api/textencoder/textencoder/index.md
diff options
context:
space:
mode:
Diffstat (limited to 'files/fr/web/api/textencoder/textencoder/index.md')
-rw-r--r--files/fr/web/api/textencoder/textencoder/index.md66
1 files changed, 66 insertions, 0 deletions
diff --git a/files/fr/web/api/textencoder/textencoder/index.md b/files/fr/web/api/textencoder/textencoder/index.md
new file mode 100644
index 0000000000..739e661142
--- /dev/null
+++ b/files/fr/web/api/textencoder/textencoder/index.md
@@ -0,0 +1,66 @@
+---
+title: TextEncoder()
+slug: Web/API/TextEncoder/TextEncoder
+translation_of: Web/API/TextEncoder/TextEncoder
+---
+<p>{{APIRef("Encoding API")}}</p>
+
+<p>Le constructeur <code><strong>TextEncoder()</strong></code> retourne un nouvel objet {{DOMxRef("TextEncoder")}} utf-8.</p>
+
+<h2 id="Syntaxe">Syntaxe</h2>
+
+<pre class="syntaxbox"><var>encoder</var> = new TextEncoder();
+</pre>
+
+<h3 id="Paramètre">Paramètre</h3>
+
+<ul>
+ <li><code>TextEncoder()</code> ne prend plus de paramètre depuis Firefox 48 et Chrome 53.</li>
+</ul>
+
+<div class="note">
+<p><strong>Note :</strong> Avant Firefox 48 et Chrome 53, le nom de l'encodage était accepté comme un paramètre pour l'objet <code>TextEncoder</code>, depuis ces deux navigateurs ont supprimé le support pour les encodages autres que l'<code>utf-8</code> afin de respecté les <a href="https://www.w3.org/TR/encoding/#dom-textencoder">spécifications</a>. N'importe quel indication d'encodage passé au constructeur sera ignoré et un <code>utf-8</code> <code>TextEncoder</code> sera créé.</p>
+</div>
+
+<h3 id="Exceptions">Exceptions</h3>
+
+<ul>
+ <li><code>TextEncoder()</code> ne lève plus d’exception depuis Firefox 48 et Chrome 53</li>
+</ul>
+
+<div class="note">
+<p><strong>Note :</strong> Avant Firefox 48 et Chrome 53, une exception était levée pour les types d'encodage inconnu.</p>
+</div>
+
+<h2 id="Spécification">Spécification</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Spécification</th>
+ <th scope="col">Statu</th>
+ <th scope="col">Commentaire</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName("Encoding", "#dom-textencoder", "TextEncoder()")}}</td>
+ <td>{{Spec2("Encoding")}}</td>
+ <td>Définition initiale</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>
+
+<div>
+
+
+<p>{{Compat("api.TextEncoder.TextEncoder")}}</p>
+</div>
+
+<h2 id="Voir_aussi">Voir aussi</h2>
+
+<ul>
+ <li>L'interface {{DOMxRef("TextEncoder")}} appartenant à ce constructeur.</li>
+</ul>