Skip to content

Node.js module to fix errors when converting Latin-1 encoded text to UTF-8

License

Notifications You must be signed in to change notification settings

Fdawgs/fix-latin1-to-utf8

Folders and files

NameName
Last commit message
Last commit date
Feb 6, 2025
Feb 6, 2025
Jan 30, 2024
Feb 5, 2025
Jan 13, 2025
Jan 13, 2025
Jan 30, 2024
Mar 9, 2024
Jan 30, 2025
Aug 5, 2024
Oct 14, 2024
Jan 30, 2024
Feb 6, 2025
Feb 6, 2025
Jan 9, 2025
Feb 6, 2025
Mar 1, 2025
Jan 13, 2025

Repository files navigation

fix-latin1-to-utf8

GitHub release npm version CI Coverage status code style: Prettier

Node.js module to fix errors when converting Latin-1 encoded text to UTF-8

Overview

When converting Latin-1 (or Windows-1252) encoded text to UTF-8, some characters may be incorrectly converted. This module fixes those errors.

Installation

Install using npm:

npm i fix-latin1-to-utf8

API

API documentation can be found here.

Example usage

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.

Contributing

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.

Acknowledgements

License

fix-latin1-to-utf8 is licensed under the MIT license.