saat ini membahas tentang karakter aneh yang muncul saat kita koding android.
terutaam karakter kutip satu yang berubah jadi tanda tanya didalam kotak hitam.
solusinya ada di stackoverflow tapi saya taruh juga di blog ini. (pakai java normalizer).
java.text.Normalizer will handle this for you.
string = Normalizer.normalize(string, Normalizer.Form.NFD);
This will separate all of the accent marks from the characters. Then, you just need to compare each character against being a letter and throw out the ones that aren't.
string = string.replaceAll("[^\\p{ASCII}]", "");
trims.
No comments:
Post a Comment