Skip to content

Commit

Permalink
Add "utf8" as an accepted encoding for TextDecoder
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed Oct 8, 2023
1 parent 4d806f6 commit b433831
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/chatty-zoos-eat.md
@@ -0,0 +1,5 @@
---
'nxjs-runtime': patch
---

Add "utf8" as an accepted encoding for `TextDecoder`
2 changes: 1 addition & 1 deletion packages/runtime/src/polyfills/text-decoder.ts
Expand Up @@ -20,7 +20,7 @@ export class TextDecoder implements globalThis.TextDecoder {
fatal: boolean;
ignoreBOM: boolean;
constructor(encoding?: string) {
if (typeof encoding === 'string' && encoding !== 'utf-8') {
if (typeof encoding === 'string' && encoding !== 'utf-8' && encoding !== 'utf8') {
throw new TypeError('Only "utf-8" decoding is supported');
}
this.encoding = 'utf-8';
Expand Down

0 comments on commit b433831

Please sign in to comment.