I am trying to replace all the non latin/turkish characters, but something is wrong and I can't find it.
For example:
var texto = '*istediğiniz*';
if (texto.match(/[^a-zA-Z0-9şŞıİçÇöÖüÜĞğ\- ]/g)){
//only letters, numbers and turkish letters are allowed
texto = texto.replace(/[^a-zA-Z0-9şŞıİçÇöÖüÜĞğ\- ]/g, '');
}
console.log(texto);
As a result, my word is output incorrectly: istediiniz
. The output should be istediğiniz
.
Encode your javascript file into utf-8
and update your meta tag to:
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With