views:

275

answers:

1

My application used to use an MFC CEdit control and we had no problems with wide character (Unicode) strings. After switching to a CRichEditCtrl, it seems that Unicode is no longer supported. Chinese characters become "??" and so forth. I have read that CRichEditCtrl uses RichEdit* under the hood and I have played around with trying to cast the pointer, but nothing works.

I thought it could be the font, but I can certainly write Unicode into the control using the ALT key method, just when they are saved into the model and written back, they are "????".

Is there a hidden property somewhere, some manual setting that I have to do when initializing the dialog that will enable Unicode?

A: 

I found out that MFC Automatically uses RichEdit 1.0. Unless one uses a RichEdit 2.0, 3.0, or 4.0 implementation, one will not have true Unicode support by the rich edit. I was able to change the properties in the resource file manually: Change the class name from "RICHEDIT" to "RichEdit20W" for RichEdit 2.0 (with Unicode support).

Voila! Unicode support!

Mike Caron
Weird! Which version of VC, MFC, SDK are you using. RichEdit20W has been the default for long.
Serge - appTranslator
Using Visual C++, 2005, whatever MFC libs come with that.
Mike Caron