fix-latin1-to-utf8
Version:
Fix errors when converting Latin-1 encoded text to UTF-8
54 lines (33 loc) • 2.12 kB
Markdown
# fix-latin1-to-utf8
[](https://github.com/Fdawgs/fix-latin1-to-utf8/releases/latest/)
[](https://npmjs.com/package/fix-latin1-to-utf8)
[](https://github.com/Fdawgs/fix-latin1-to-utf8/actions/workflows/ci.yml)
[](https://coveralls.io/github/Fdawgs/fix-latin1-to-utf8?branch=main)
[](https://github.com/prettier/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`:
```bash
npm i fix-latin1-to-utf8
```
## API
API documentation can be found [here](https://github.com/Fdawgs/fix-latin1-to-utf8/blob/main/API.md).
## Example usage
```js
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](https://github.com/Fdawgs/.github/blob/main/CONTRIBUTING.md) for details on how to get started.
Please adhere to this project's [Code of Conduct](https://github.com/Fdawgs/.github/blob/main/CODE_OF_CONDUCT.md) when contributing.
## Acknowledgements
- **Tex Texin** - Creator of the [UTF-8 Encoding Debugging Chart](http://www.i18nqa.com/debug/utf8-debug.html)
## License
`fix-latin1-to-utf8` is licensed under the [MIT](./LICENSE) license.