how to show hindi character in android webview

前端 未结 5 1587
盖世英雄少女心
盖世英雄少女心 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");
    

提交回复
热议问题