为什么网页视图不显示波斯语字符?! [英] why web view doesnt show persian characters ?!

查看:77
本文介绍了为什么网页视图不显示波斯语字符?!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好。我在我的Android应用程序中使用Web视图,我必须显示一些波斯语(波斯语,فارسی)的话!但它没有正确显示它们!它只是显示一些未知的符号?!我应该怎么做才能解决它?

这是我的代码:

 字符串 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆