From b9153af4ccac49ed8a509ac659f10722cbe82ee3 Mon Sep 17 00:00:00 2001 From: Jungku Lee Date: Mon, 28 Aug 2023 00:32:47 +0900 Subject: [PATCH] doc: add print results for examples in `StringDecoder` PR-URL: https://github.com/nodejs/node/pull/49326 Refs: https://github.com/nodejs/node/pull/49143 Reviewed-By: Antoine du Hamel Reviewed-By: Deokjin Kim Reviewed-By: Luigi Pinca --- doc/api/string_decoder.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/string_decoder.md b/doc/api/string_decoder.md index 4913b26cec042f..18960f6acb1736 100644 --- a/doc/api/string_decoder.md +++ b/doc/api/string_decoder.md @@ -21,10 +21,10 @@ const { StringDecoder } = require('node:string_decoder'); const decoder = new StringDecoder('utf8'); const cent = Buffer.from([0xC2, 0xA2]); -console.log(decoder.write(cent)); +console.log(decoder.write(cent)); // Prints: ¢ const euro = Buffer.from([0xE2, 0x82, 0xAC]); -console.log(decoder.write(euro)); +console.log(decoder.write(euro)); // Prints: € ``` When a `Buffer` instance is written to the `StringDecoder` instance, an @@ -41,7 +41,7 @@ const decoder = new StringDecoder('utf8'); decoder.write(Buffer.from([0xE2])); decoder.write(Buffer.from([0x82])); -console.log(decoder.end(Buffer.from([0xAC]))); +console.log(decoder.end(Buffer.from([0xAC]))); // Prints: € ``` ## Class: `StringDecoder`