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.
- <input checked="" disabled="" type="checkbox"> Diacritics
- <input checked="" disabled="" type="checkbox"> Zero-width characters
- <input checked="" disabled="" type="checkbox"> Uncommon white spaces
- <input checked="" disabled="" type="checkbox"> 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