GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: add print results for examples in `StringDecoder` · nodejs/node@3f1a237

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • string_decoder.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/string_decoder.md‎

Copy file name to clipboardExpand all lines: doc/api/string_decoder.md
+3-3Lines changed: 3 additions & 3 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ const { StringDecoder } = require('node:string_decoder');
2121
const decoder = new StringDecoder('utf8');
2222

2323
const cent = Buffer.from([0xC2, 0xA2]);
24-
console.log(decoder.write(cent));
24+
console.log(decoder.write(cent)); // Prints: ¢
2525

2626
const euro = Buffer.from([0xE2, 0x82, 0xAC]);
27-
console.log(decoder.write(euro));
27+
console.log(decoder.write(euro)); // Prints: €
2828
```
2929

3030
When a `Buffer` instance is written to the `StringDecoder` instance, an
@@ -41,7 +41,7 @@ const decoder = new StringDecoder('utf8');
4141

4242
decoder.write(Buffer.from([0xE2]));
4343
decoder.write(Buffer.from([0x82]));
44-
console.log(decoder.end(Buffer.from([0xAC])));
44+
console.log(decoder.end(Buffer.from([0xAC]))); // Prints: €
4545
```
4646

4747
## Class: `StringDecoder`

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.