We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6aaee14 commit cd6e2e2Copy full SHA for cd6e2e2
1 file changed
src/util/utf8.js
@@ -7,7 +7,14 @@
7
*/
8
var utf8 = exports,
9
replacementChar = "\ufffd",
10
+ strictDecoder;
11
+
12
+try {
13
strictDecoder = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true });
14
+} catch (err) {
15
+ // "fatal" option is not supported on Node.js compiled without ICU
16
+ strictDecoder = new TextDecoder("utf-8", { ignoreBOM: true });
17
+}
18
19
/**
20
* Calculates the UTF8 byte length of a string.
0 commit comments