diff --git a/doc/api/buffer.md b/doc/api/buffer.md index ae0182aea5..d7e29966bc 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -2328,6 +2328,8 @@ The transcoding process will use substitution characters if a given byte sequence cannot be adequately represented in the target encoding. For instance: ```js +const buffer = require('buffer'); + const newBuf = buffer.transcode(Buffer.from('€'), 'utf8', 'ascii'); console.log(newBuf.toString('ascii')); // Prints: '?'