https://github.com/maxlath/fix-utf8
Fix Unicode encoding errors
https://github.com/maxlath/fix-utf8
utf8
Last synced: 7 months ago
JSON representation
Fix Unicode encoding errors
- Host: GitHub
- URL: https://github.com/maxlath/fix-utf8
- Owner: maxlath
- License: mit
- Created: 2017-04-27T12:11:53.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2024-07-17T10:54:48.000Z (about 1 year ago)
- Last Synced: 2025-02-26T18:49:53.150Z (8 months ago)
- Topics: utf8
- Language: JavaScript
- Size: 62.5 KB
- Stars: 26
- Watchers: 4
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# fix-utf8
A function that tries its best to recover lost Latin Unicode characters, based on the [UTF-8 Encoding Debugging Chart](http://www.i18nqa.com/debug/utf8-debug.html#dbg)
Also takes the opportunity to [normalize](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) the passed string, replacing any [combined group of characters](https://en.wikipedia.org/wiki/Combining_character) by their corresponding glyph.
## Install
```sh
$ npm install fix-utf8
```## How-To
```js
import fixUtf8 from 'fix-utf8'fixUtf8("L'avenir des idées")
// => "L'avenir des idées"
```## See Also
* [forceutf8](https://github.com/neitanod/forceutf8) (PHP)## License
[MIT](LICENSE.md)