I had Database in which data stored in hindi as \u092e\u0948\u0902 \u0924\
and setting that content to webview using below.
webview1.loadData(hindi_content, "text/html", "UTF-8");
But it will display as
I don't know why that's happening. Any one please suggest. how to fix that !
Hindi Content Not displayed in MS Word etc application. Solution: Install Hindi Unicode Font like Mangal, Arial Unicode MS, Aparajita etc. If you are using Windows XP or older windows OS, then you have to install Hindi Language pack also. After that you will see Hindi content and text in any application.
Mangal font is one of the Unicode font used for Hindi Typing on Websites and Online Work.
You can download Top Hindi Fonts (Devanagari, Nepali, Sanskrit and Marathi Font). We also have popular fonts like Devlys and Kruti Dev!
This happens because of a bug with the encoding parameter of loadData
in most Android versions. This parameter is ignored for some reason so the UTF-8 based hindi characters will not be rendered.
To fix this you can use one of the following alternatives.
webview1.loadData(hindi_content, "text/html; charset=UTF-8", null);
webview1.loadDataWithBaseURL(null, hindi_content, "text/html", "utf-8", null);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With