how to show hindi character in android webview

前端 未结 5 1565
盖世英雄少女心
盖世英雄少女心 2020-12-15 15:19

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

相关标签:
5条回答
  • 2020-12-15 15:34

    Me also struggled with this for one day but finally found a solution.

    Just add these two lines of code it will work

    WebSettings webSettings = webView.getSettings();
    webSettings.setDefaultTextEncodingName("utf-8");
    
    0 讨论(0)
  • 2020-12-15 15:41

    Hindi is not supported in most devices.

    But you still can browse Hindi websites using the app, SETT Hindi Browser if your Android version is above 2.2. It's an exclusive browser for Hindi & it displays Hindi in any device.

    Here is the link: https://market.android.com/details?id=lk.bhasha.sett.hindi

    Here is how it displays Hindi: Google search results on SETT Hindi Browser - Android

    0 讨论(0)
  • 2020-12-15 15:45

    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

    0 讨论(0)
  • 2020-12-15 15:50

    With Opera Mini browser, now you can read Indian language content on mobile phones which don't have built in unicode fonts. For this we need to turn on the bitmap fonts in 'opera mini'

    1. Type 'about: config' in mini address bar. This opens configuration settings.
    2. There is a option for use bitmap fonts. Change that to Yes.
    0 讨论(0)
  • 2020-12-15 15:53

    There is no way (not yet) to show any of the Indian characters of Indian languages on Android. It simply is not supported. See the following links for further information:

    Link 1
    Link2

    It existed as a feature request, at least until 2.2. I am not sure if language support has been added for Hindi and other Indian languages from Android 2.3 and 3.0 onwards.

    On a side note, does the same website work properly when you open it with a normal web browser?

    0 讨论(0)
提交回复
热议问题