Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js replace diacritics

// this will keep symbols
console.log( "âîÂșț12@.".normalize('NFD').replace(/[u0300-u036f]/g, "") );
//output: aiAst12@.

console.log( "âîÂșț12@.".normalize('NFKD').replace(/[^w]/g, '') );
// output: aiAst12
 
PREVIOUS NEXT
Tagged: #js #replace #diacritics
ADD COMMENT
Topic
Name
1+2 =