An open API service indexing awesome lists of open source software.

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

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)