Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Updated 26-Sep-11 0:21am
v2

1 solution

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[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900