I want to display some text in hindi that I am getting from server.
While showing the text some weird characters are displayed (à¤à¥à¤¸à¥à¤à¤¿à¤à¤). But in iOS its showing perfectly
I think its some encoding issue
I want to display some text in hindi that I am getting from server.
While showing the text some weird characters are displayed (à¤à¥à¤¸à¥à¤à¤¿à¤à¤). But in iOS its showing perfectly
I think its some encoding issue
By default Android phone (Now some does support) doesn’t support Devanagari fonts. However if you want to use hindi, tamil, bangali or other Devanagari fonts in your Android Application you have an alternative of using external fonts.
Follow these steps...
Download an external Devanagari font that you like to use in your application. ex. (Verdana.ttf or anand-lipi-bold)
Create a new folder “fonts” under assets and copy the downloaded .ttf font to your assets/font folder.
then Load .ttf to your TextView.
TextView tv = (TextView) findViewById(R.id.textView);
Typeface fontHindi = Typeface.createFromAsset(getAssets(),
"fonts/Ananda Lipi Bold Cn Bt.ttf");
tv.setTypeface(fontHindi);
tv.setText("Hindi font");
Hope this will help you.
Please use below Code for getting string
new String("Your String".getBytes("ISO-8859-1"), "utf-8")
I was also getting some arabic string from server and it was displaying some chaaracters like yours but after using this it solved
Here instead of ISO-8859-1 you can use encode type in which data is encoded on server side
Finally got an answer myself I am using volley as my networking library and by default its encoding was in latin-1 So after changing to utf-8 it worked perfectly
Thanks everyone for your help