I have downloaded a word meaning Android sqlite.db dictionary file. By fetching SQL query I got
enslishWord="plausible";
hindiMeaning="lR;kHkklh]diViw.kZ]";
By using Hindi Typeface in TextView I got proper Hindi meaning. If I try to print by System.out.println(hindiMeaning);
it prints lR;kHkklh]diViw.kZ]
I am confused about the problem and looking for a solution. Please, check the raw Android sqlite.db Github link in comment sections.
2
Answers
add this class
Add this method to you activity
call method
to show toast
to set text
Are you trying to print the non-English characters in Console?
android.graphics.Typeface is an Android-specific class whereas System.out.println is a Java-specific function. You can’t expect the Java console to print out the non-English characters by default.
In Android Studio the default encoding can be set in the studio64.exe.vmoptions file as an ordinary VM parameter. This file is located inside the root folder of your Android Studio installation and contains a set of JVM parameters. Add
-Dfile.encoding=UTF-8
there to set encoding in UTF-8.Alternatively, you can change the option via the settings.
Reference: IntelliJ IDEA incorrect encoding in console output