Skip to content

Instantly share code, notes, and snippets.

@kalkulus
Created November 22, 2017 13:15
Show Gist options
  • Save kalkulus/5d536faba9a6d4d8c0413a5989cd46ac to your computer and use it in GitHub Desktop.
Save kalkulus/5d536faba9a6d4d8c0413a5989cd46ac to your computer and use it in GitHub Desktop.
UTF-8 to ASCII conversion
// 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