为什么网页视图不显示波斯语字符?! [英] why web view doesnt show persian characters ?!
本文介绍了为什么网页视图不显示波斯语字符?!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的代码:
字符串 txt = < html>< body> + سلامبربرنامهنویساناندروید + < / body>< / html>;
WebView wv;
wv =新的WebView( this );
wv.loadData(txt, text / html, utf-8);
LinearLayout ll =(LinearLayout)findViewById(R.id.myll);
ll.addView(wv);
解决方案
wv.loadDataWithBaseURL(null,txt , text / html, utf-8,null);
hello people . i am using web view in my android application and i have to show some persian (Farsi , فارسی ) words ! but it doesn't show them correctly ! it just shows some unknown symbols ?! what should i do to fix it ?!
it is my code :
String txt="<html><body>"+"سلام بر برنامه نویسان اندروید "+"</body></html>";
WebView wv;
wv=new WebView(this);
wv.loadData(txt, "text/html", "utf-8");
LinearLayout ll=(LinearLayout) findViewById(R.id.myll);
ll.addView(wv);
解决方案
wv.loadDataWithBaseURL(null,txt, "text/html", "utf-8",null);
这篇关于为什么网页视图不显示波斯语字符?!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文