
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
Replaces busted characters carried over from legacy text encodings with the proper UTF-8 characters.
Replaces busted characters carried over from legacy text encodings with the proper UTF-8 characters.
yarn add utfu || npm install utfu
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)
// --> 'On a certain level, it\u2019s like shouting \u201Cfire\u201D in a crowded theater.'
const cleanHTML = htx(dirty)
// --> 'On a certain level, it’s like shouting “fire” in a crowded theater.'
const cleanTxt = txt(dirty)
// --> 'On a certain level, itās like shouting āfireā in a crowded theater.'
yarn test
š¤ Daniel Sieradski hello@self.agency
Gracious thanks to Mathias Bynens, upon whose he and windows-1252 packages this project depends.
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a āļø if this project helped you!
FAQs
Replaces busted characters carried over from legacy text encodings with the proper UTF-8 characters.
We found that utfu demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.Ā It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.