CRichedit和CHTMLVIewer的多语言问题 [英] Multilanguage Problem with CRichedit and CHTMLVIewer

查看:92
本文介绍了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类(其他,可能是此代码项目的文章: 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屋!

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