无法在C#CGI应用程序中显示unicode字符 [英] Cannot display unicode characters in C# CGI application

查看:50
本文介绍了无法在C#CGI应用程序中显示unicode字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用C#CGI作为网站。当一切都是英文时,应用程序运行良好。但是,如果我试图显示unicode字符,系统就无法工作。

I am using C# CGI for a web site. When everything is in English, the application works great. However, if I tried to display unicode characters, the system just cannot work.

我知道我可以将Console.OutputEncoding设置为Unicode,然后CGI可以正确输出Unicode字符。但是,它无法设置回原始编码,因此我的所有其他HTML标记也将以unicode格式显示。它会使
我的显示无效! 

I know that I can set the Console.OutputEncoding to Unicode, then the CGI could output Unicode characters properly. However, it cannot be set back to the original encoding so that all my other HTML tags would also be displayed in unicode format. It make my display not work! 

推荐答案

您是否尝试过其他编码:
Encoding.UTF8

还可以考虑指定文档的编码,例如,使用
"Content-type:text / html; charset = utf-8"标题。这取决于您的实施细节。

Also consider specifying the encoding of the document, using, for example, the "Content-type: text/html; charset=utf-8" header. It depends on details of your implementation.


这篇关于无法在C#CGI应用程序中显示unicode字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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