1

I am using realm to store and retrieve utf-8 for nepali(Devnagari) characters but when retrieving � is also generating which is not a nepali(Devnagari) character and not stored. How to solve this issue? Along with realm I have used Gson and retrofit.

Gson gson =  new GsonBuilder().disableHtmlEscaping().create();
final RealmResults<Information> realmObj = realm.where(Information.class).findAll();
if (realmObj != null) {
    List<Information> obj = realm.copyFromRealm(realmObj); 
    String json = gson.toJson(obj);                     
}

which generates

२५ द���खि ४० वर्षः
Aaiam Litigoner
  • 98
  • 1
  • 12
  • Did you look into this link - https://stackoverflow.com/a/4147245/3145960 – Reaz Murshed Mar 11 '18 at 10:27
  • yes i tried it and didnt work – Aaiam Litigoner Mar 12 '18 at 04:47
  • 1
    � is a marker to tell users that programmers have mishandled their text and lost some of it. Unfortunately, I can only suggest finding some other way of checking that the text is stored properly so you can tell if the mishandling is before or during storage, or after or during retrieval. – Tom Blodget Mar 12 '18 at 23:24

0 Answers0