Im converting diacritic names to normal letters using this code:
public String convert (){
SQLiteDatabase db = this.getReadableDatabase();
Cursor c = db.rawQuery("Select firstname,middlename,lastname from tblvoters", null);
String converted = "";
if(c.moveToFirst()){
for(int i=0;c.length(i);i ++){
converted = Normalizer.normalize(c, Normalizer.Form.NFD).replaceAll("[^\\p{ASCII}]", "");
}
}while(c.moveToNext());{
}
c.close();
db.close();
return converted;
} I have 15k names inserted in the database so this function can really can help me convert the diacritic names easily. but it is not working. Any advice or help would be awesome !
Aucun commentaire:
Enregistrer un commentaire