Created
November 22, 2017 13:15
-
-
Save kalkulus/5d536faba9a6d4d8c0413a5989cd46ac to your computer and use it in GitHub Desktop.
UTF-8 to ASCII conversion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// source https://stackoverflow.com/a/23633988 | |
const str = "üó"; | |
const utf2ascii = (text) => { | |
const combining = /[\u0300-\u036F]/g; | |
return str.normalize('NFKD').replace(combining, '')); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment