Node.js module to fix errors when converting Latin-1 encoded text to UTF-8
When converting Latin-1 (or Windows-1252) encoded text to UTF-8, some characters may be incorrectly converted. This module fixes those errors.
Install using npm
:
npm i fix-latin1-to-utf8
Please refer to the JSDoc comments in the source code or the generated type definitions for information on the available options.
const fixLatin1ToUtf8 = require("fix-latin1-to-utf8");
const latin1String =
"This is a UTF-8 string that was converted from Latin-1‚ but the conversion was not great.";
const utf8String = fixLatin1ToUtf8(latin1String);
console.log(utf8String);
// This is a UTF-8 string that was converted from Latin-1, but the conversion was not great.
Contributions are welcome, and any help is greatly appreciated!
See the contributing guide for details on how to get started. Please adhere to this project's Code of Conduct when contributing.
- Tex Texin - Creator of the UTF-8 Encoding Debugging Chart
fix-latin1-to-utf8
is licensed under the MIT license.