Created
December 12, 2018 05:34
-
-
Save etoxin/3095c64e3fe9e8dfcda5cf8eccac0567 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getEncoder(encoding) { | |
const encoder = encoding === "utf8" ? new UTF8Encoder() | |
: encoding === "utf16le" ? new UTF16Encoder(false) | |
: encoding === "utf16be" ? new UTF16Encoder(true) | |
: throw new Error("Unsupported encoding"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment