Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
972 views
in Technique[技术] by (71.8m points)

how to show hindi character in android webview

how to show hindi characters in android ,i have simple webview apllication ,it loads the url of some site which contains hindi characters ,but its showing [][][][ at place of those characters ,even the default android browser shows the same (not showing the hindi characters) the android version is 2.1, text encoding is set on unicode(UTF-8) in default android browser .,is there is any way to get the support for hindi characters i hope my question is clear ,

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Its the font-support

The Characters other than the most Basic ones, are not there in the TTF Font Files - Namely, DroidSans and DroidSansFallback

Any system needs to have the font on it to display the same.
In case of web pages, you can provide the font to the client to download and use

But in case of Android, its supposed to load characters only from DroidSans.ttf and DroidSansFallback.ttf

So if you want to view something in Hindi, these font files ( in system/fonts ) must support your characters

Your Options...

  1. DroidSans.ttf is limited so you can't edit that. Download any font that has Hindi Character support and name it to DroidSans.ttf and replace in system/fonts.
    - This will mess your default font

  2. Download a TTF font that has Hindi Characters and Name it to DroidSansFallback.ttf and replace in system/fonts.
    - This won't mess up anything & is a Better Option

  3. Create a font using Font Designing Softwares and ADD as many characters as you wish (including HINDI) and follow the latter part of statement 2.
    - The BEST Option !!

  4. Use a Browser that has its own support for Hindi Fonts.
    - Simplest option for people without ROOT *


* - Root implies Rooting of Android Device - Rooting Android


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...