CRichedit和CHTMLVIewer的多语言问题 [英] Multilanguage Problem with CRichedit and CHTMLVIewer
本文介绍了CRichedit和CHTMLVIewer的多语言问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我做了一个简单的聊天程序.我将CRichedit控件用于输入文本,并将HTMLViewer控件(CHTMLViewer类)用于显示文本.如果输入中文或日语文本,则HTMLViewer中该文本会崩溃. HTMLViewer的字符集为UTF-8.
如何解决此问题?
谢谢.
I made a simple chat program. I used CRichedit control for input text, and used HTMLViewer control (CHTMLViewer class) for display text. If I input chinese or japanese text, it is crashed in HTMLViewer. Charset of HTMLViewer is UTF-8.
How can I fix this problem?
Thank you.
推荐答案
您是说CHtmlView类(来自Microsoft的MFC的一部分)还是CHTMLViewer类(其他,可能是此代码项目的文章: ^ ])?
如果您可以将其输入到CRichedit控件中,为什么不也将其显示在CRichedit控件中?这样,您不必担心将其从一个字符集转换为另一个字符集.
否则,您可能需要从Unicode转换为UTF-8.
.NET有一个类可以做到这一点.
对于MFC,您可以尝试以下操作:
http://archive.msdn.microsoft.com/UTF8Helpers [
Do you meant CHtmlView class (part of MFC from Microsoft) or CHTMLViewer class (something else, possibly this codeproject article: CHTMLViewer[^] )?
If you can input it into a CRichedit control, why don''t you display it in a CRichedit control as well? That way you wouldn''t have to worry about converting it from one character set to another.
Otherwise, you probably need to convert from unicode to UTF-8.
.NET has a class to do this.
For MFC, you can try this:
http://archive.msdn.microsoft.com/UTF8Helpers[^]
这篇关于CRichedit和CHTMLVIewer的多语言问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文