Reputation: 850
I am trying to paste Hindi characters in an array with elements like
String[] arr = {"आपका स्वागत है","आपका स्वागत है"};
but its giving error i.e.
"some characters cannot be mapped using "Cp1252" character encoding"
while saving this.
Upvotes: 5
Views: 9000
Reputation: 850
Thanks i found the solution...
Create an array under the value folder
Use the font that support Hindi under the assets folder
textview.setTypeface(Typeface.createFromAsset(getAssets(),"fonts/Hindi.ttf"));
its working fine...
Upvotes: 0
Reputation: 850
Thanks i found the solution...
textview.setTypeface(Typeface.createFromAsset(getAssets(),"fonts/Hindi.ttf"));
its working fine...Upvotes: 3
Reputation: 2178
Switch your text encoding to UTF-8.
In Eclipse go to Window -> Preferences, select General -> Workspace. From the Text file encoding dropdown, select UTF-8.
Upvotes: 4