Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7ca416a

Browse filesBrowse files
addaleaxtargos
authored andcommitted
doc: add missing setEncoding call in ESM example
Adding `setEncoding()` ensures that the example handles characters split across chunk boundaries well. PR-URL: #47558 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Harshitha K P <harshitha014@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
1 parent f9abd59 commit 7ca416a
Copy full SHA for 7ca416a

File tree

Expand file treeCollapse file tree

1 file changed

+1
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/esm.md‎

Copy file name to clipboardExpand all lines: doc/api/esm.md
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,7 @@ export function load(url, context, nextLoad) {
10581058
return new Promise((resolve, reject) => {
10591059
get(url, (res) => {
10601060
let data = '';
1061+
res.setEncoding('utf8');
10611062
res.on('data', (chunk) => data += chunk);
10621063
res.on('end', () => resolve({
10631064
// This example assumes all network-provided JavaScript is ES module

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.