WPF WebBrowser NavigateToString vs NavigateToStream (Hebrew / non-utf8 encodings)

When I use WPF WebBrowser's NavigateToString method to display UTF8 html (with Hebrew text) it renders fine.

However, when I try to use NavigateToString to display html with Hebrew text in it in non-utf8 encoding (CodePage 1255 to be exact), Hebrew gets messed up.

I checked the line cp1255 in the Visual Studio debugger and it looks great and also when I save the source code of the web browser content and open it with an external browser it looks great.

If I use the NavigateToStream method instead of the NavigateToString method, it works fine.

What's the problem with NavigateToString? am i something wrong?

+2


a source to share


1 answer


NavigateToString = NavigateToStream + UTF8NoBOM Use NavigateToStream and make sure you have the correct encoding in the stream data.



0


a source







All Articles