Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hindi Character will not display in web view correctly

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

hindi content display as

I don't know why that's happening. Any one please suggest. how to fix that !

like image 679
user1621629 Avatar asked Feb 18 '13 09:02

user1621629


People also ask

Why Hindi font not displaying in MS word?

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.

Which Hindi font used in website?

Mangal font is one of the Unicode font used for Hindi Typing on Websites and Online Work.

What is the name of Hindi font in MS Word?

You can download Top Hindi Fonts (Devanagari, Nepali, Sanskrit and Marathi Font). We also have popular fonts like Devlys and Kruti Dev!


1 Answers

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);
like image 128
Leon Lucardie Avatar answered Oct 12 '22 05:10

Leon Lucardie