本文介绍了网络浏览器编码问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在项目中使用 WebBrowser
控件.我的代码示例如下:
I am using a WebBrowser
control in my project. My code example is below:
webBrowser1.Navigate("Web Site goes here");
网络浏览器正在浏览Google网站,但是我看不到土耳其语字符.
The web browser is navigating the Google website, however I can not see the Turkish characters.
因此,我使用:
webBrowser1.Document.Encoding = "UTF-8"
但是问题仍然存在.有解决这个问题的主意吗?
However the problem still continues. Any idea to solve this?
推荐答案
StreamReader sr = new StreamReader(this.webBrowser1.DocumentStream, Encoding.GetEncoding("UTF-8"));
string source = sr.ReadToEnd();
,或者您可以尝试使用"iso-8859-9"进行编码.这应该做到.
or you can try "iso-8859-9" for encoding.this should do it.
这篇关于网络浏览器编码问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!