| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 45caad8 commit 3f1a237
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,10 +21,10 @@ const { StringDecoder } = require('node:string_decoder'); | |||
| 21 | 21 | const decoder = new StringDecoder('utf8'); | |
| 22 | 22 | ||
| 23 | 23 | const cent = Buffer.from([0xC2, 0xA2]); | |
| 24 | - console.log(decoder.write(cent)); | ||
| 24 | + console.log(decoder.write(cent)); // Prints: ¢ | ||
| 25 | 25 | ||
| 26 | 26 | const euro = Buffer.from([0xE2, 0x82, 0xAC]); | |
| 27 | - console.log(decoder.write(euro)); | ||
| 27 | + console.log(decoder.write(euro)); // Prints: € | ||
| 28 | 28 | ``` | |
| 29 | 29 | ||
| 30 | 30 | When a `Buffer` instance is written to the `StringDecoder` instance, an | |
@@ -41,7 +41,7 @@ const decoder = new StringDecoder('utf8'); | |||
| 41 | 41 | ||
| 42 | 42 | decoder.write(Buffer.from([0xE2])); | |
| 43 | 43 | decoder.write(Buffer.from([0x82])); | |
| 44 | - console.log(decoder.end(Buffer.from([0xAC]))); | ||
| 44 | + console.log(decoder.end(Buffer.from([0xAC]))); // Prints: € | ||
| 45 | 45 | ``` | |
| 46 | 46 | ||
| 47 | 47 | ## Class: `StringDecoder` | |
| Back | FazBrowse Home | New Git URL |
0 commit comments