You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 4-binary/02-text-decoder/article.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
¿Qué pasa si los datos binarios son en realidad un string? Por ejemplo, recibimos un archivo con datos textuales.
4
4
5
-
Al proporcionar el búfer y la codificación, el objeto [TextDecoder](https://encoding.spec.whatwg.org/#interface-textdecoder) nos permite leer el texto de un conjunto de datos binarios y convertirlo en un dato de tipo string de JavaScript.
5
+
El objeto [TextDecoder](https://encoding.spec.whatwg.org/#interface-textdecoder) nos permite leer el texto de un conjunto de datos binarios y convertirlo en un dato de tipo string de JavaScript, dados el búfer y la codificación.
6
6
7
7
Primero necesitamos crearlo:
8
8
```js
@@ -54,7 +54,7 @@ alert( new TextDecoder().decode(binaryString) ); // Hola
54
54
55
55
## TextEncoder
56
56
57
-
[TextEncoder](https://encoding.spec.whatwg.org/#interface-textencoder) hace lo contrario -- convierte un string en bytes.
57
+
[TextEncoder](https://encoding.spec.whatwg.org/#interface-textencoder) hace lo contrario: convierte un string en bytes.
0 commit comments