When I use WPF WebBrowser's NavigateToString method to display UTF8 html (with hebrew text in it) it's displayed perfectly.
当我使用WPF WebBrowser的NavigateToString方法来显示UTF8 html(带有希伯来文文本)时,它会完美地显示出来。
However, when I try to use the NavigateToString to display html with hebrew text in it in a non-utf8 encoding (CodePage 1255 to be exact) the hebrew is messed up.
然而,当我尝试使用NavigateToString在它的非utf8编码中(确切地说是CodePage 1255)在它中显示带有希伯来文本的html时,希伯来语是混乱的。
I checked the cp1255 string in Visual Studio's debugger and it looks great, and also when I save the source of the web browser's contents and open it with an external browser it looks great.
我在Visual Studio的调试器中检查了cp1255字符串,它看起来很棒,而且当我保存web浏览器内容的源代码并使用外部浏览器打开时,它看起来也很棒。
If I use the NavigateToStream method instead of the NavigateToString method it works great.
如果我使用的是NavigateToStream方法而不是NavigateToString方法,那么它的效果会很好。
What's the problem with the NavigateToString? am I doing something wrong?
NavigateToString的问题是什么?我做错什么了吗?
1 个解决方案
#1
0
NavigateToString= NavigateToStream + UTF8NoBOM Use NavigateToStream and make sure you have the correct encoding in the stream data.
NavigateToString= NavigateToStream + UTF8NoBOM使用NavigateToStream并确保在流数据中有正确的编码。
#1
0
NavigateToString= NavigateToStream + UTF8NoBOM Use NavigateToStream and make sure you have the correct encoding in the stream data.
NavigateToString= NavigateToStream + UTF8NoBOM使用NavigateToStream并确保在流数据中有正确的编码。