https://github.com/fdawgs/fix-latin1-to-utf8
Node.js module to fix errors when converting Latin-1 encoded text to UTF-8
https://github.com/fdawgs/fix-latin1-to-utf8
encoding iso-8859-1 iso8859-1 latin-1 latin1 utf8 windows-1252 windows1252
Last synced: 4 months ago
JSON representation
Node.js module to fix errors when converting Latin-1 encoded text to UTF-8
- Host: GitHub
- URL: https://github.com/fdawgs/fix-latin1-to-utf8
- Owner: Fdawgs
- License: mit
- Created: 2024-01-30T17:41:05.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-10T08:58:34.000Z (7 months ago)
- Last Synced: 2024-10-12T07:43:41.165Z (6 months ago)
- Topics: encoding, iso-8859-1, iso8859-1, latin-1, latin1, utf8, windows-1252, windows1252
- Language: JavaScript
- Homepage: https://npmjs.com/package/fix-latin1-to-utf8
- Size: 56.6 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```## Example usage
Please refer to the [JSDoc comments in the source code](./src/index.js) or the [generated type definitions](https://www.npmjs.com/package/fix-latin1-to-utf8?activeTab=code) for information on the available options.
```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.