🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

utfu

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

utfu

Attempts to fix busted character encodings carried over from legacy text formats.

Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
22
4.76%
Maintainers
1
Weekly downloads
 
Created
Source

Welcome to utfu 👋

Version License: MIT Twitter: selfagency\_llc

Attempts to fix busted character encodings carried over from legacy text formats. This is a work-in-progress and not yet ready for production use.

Install

yarn add utfu || npm install utfu

Usage

Pass a string to either method, hex or txt. The former tries to do a regex search and replace for unicode chars. The latter tries to do a search and replace for characters in their typical misrendering (see chart here).

import utfu from 'utfu'

const dirtyText = 'On a certain level, it�s like shouting �fire� in a crowded theater.'

const cleanText = utfu.hex(dirtyText) || utfu.txt(dirtyText)

// --> 'On a certain level, it’s like shouting “fire” in a crowded theater.'

Run tests

yarn run test

Author

👤 Daniel Sieradski daniel@self.agency

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

This README was generated with ❤️ by readme-md-generator

FAQs

Package last updated on 29 Apr 2020

Did you know?

Socket

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.

Install

Related posts