üŧāØĆ» ā utfu

Replaces busted characters carried over from legacy text encodings with the proper UTF-8 characters.
Install
yarn add utfu || npm install utfu
Usage
Say you've got a string that looks like this:
ThereĆ¢ā¬ā¢s no way IĆ¢ā¬ā¢m paying Ć¢ā¬30 for that!
Pass it to either method, hex, htx, or txt, and you'll hopefully get back:
Thereās no way Iām paying ā¬30 for that!
-
hex substitutes unicode hex values (ie., \u20ac)
-
htx substitutes the HTML escape sequence (ie., €)
-
txt substitutes the actual character (ie., ā¬)
-
See substitution chart here for mappings, more or less
import { hex, htx, txt } from 'utfu'
const dirty = 'On a certain level, itļæ½s like shouting ļæ½fireļæ½ in a crowded theater.'
const cleanHex = hex(dirty)
const cleanHTML = htx(dirty)
const cleanTxt = txt(dirty)
Run tests
yarn test
Author
š¤ Daniel Sieradski hello@self.agency
Acknowledgements
Gracious thanks to Mathias Bynens, upon whose he and windows-1252 packages this project depends.
Contributing
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Show your support
Give a āļø if this project helped you!