【问题标题】:Displaying Unicode in the WPF Webbrowser Control在 WPF Web 浏览器控件中显示 Unicode
【发布时间】:2015-07-29 15:50:30
【问题描述】:

我试图在 WPF WebBrowser 控件的 html 字符串中显示 unicode 字符,但它似乎不起作用。我正在使用以下html:

<html>
    <head>
        <title/>
    </head>
    <body>
        <div>Łuk zwykły</div>
    </body>
</html>

我已将 IE Emulation 设置为 IE 11 (11000) 并设置了默认字符集:

 DirectCast(CurrentWebBrowser.Document, IHTMLDocument2).defaultCharset = "UTF-8"

文件是 UTF-8 格式,但显示的是这样的:

Åuk zwykÅ‚y

【问题讨论】:

    标签: wpf unicode webbrowser-control


    【解决方案1】:

    您可以在 HTML 中指定编码

    <head>
    <meta charset="UTF-8">
    </head>
    

    【讨论】:

    • 我可以发誓我已经尝试过了,但现在可以了。谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-06-04
    • 2012-03-01
    • 2014-06-09
    • 1970-01-01
    • 2015-12-12
    • 1970-01-01
    • 2015-04-14
    相关资源
    最近更新 更多