normalize-unicode-text
v0.0.1
Published
Normalize strings with diacritics, zero-width whitespaces and other non-latin characters
Downloads
10,155
Maintainers
Readme
Normalize Unicode Text
Small typed function (~330 bytes) without dependencies that normalizes unicode text. Useful for normalizing strings such as shipping addresses for third party APIs.
- [x] Diacritics
- [x] Zero-width characters
- [x] Uncommon white spaces
- [x] Non-latin characters (see this list, PRs with more characters are welcome)
Installation & Usage
yarn add normalize-unicode-text
Or drop it as <script src="https://unpkg.com/normalize-unicode-text">
. In this case, use window.normalizeUnicodeText
.
Usage
import { normalizeUnicodeText } from 'normalize-unicode-text'
console.log(normalizeUnicodeText('øqßweŁffÆǣ'))
// oqssweLffAEae
console.log(normalizeUnicodeText('äÄàÀãÃçÇõÕûÛýÝñ'))
// aAaAaAcCoOuUyYn