Link to home
Start Free TrialLog in
Avatar of jhp333
jhp333Flag for United States of America

asked on

VC++ button control with special character or symbol

Using Visual Studio 2005, I added a symbol, a triangle character "¿", to the caption of a button control.
It looks fine in the resource editor, so does in test dialog view.
But when the project is built and run, the symbol just appears as a question mark.
I tried changing the font property of the dialog box without luck.
Am I missing something?
Thank you.
Avatar of jhp333
jhp333
Flag of United States of America image

ASKER

The symbol does not appear correctly in the body of this post either.
"¿"
ASKER CERTIFIED SOLUTION
Avatar of pgnatyuk
pgnatyuk
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
For Copyright symbol:

// 0xA9 is the hex for copyright symbol.
const LPCWSTR lpszCopyright = L"Copyright \xA9 cool";

Avatar of jhp333

ASKER

Thank you for your answer.
You're right, the project doesn't support Unicode. But SetDlgItemText fixes the problem, even when the symbol is not in the font for the dialog box. So I guess it's an issue with the resource editor.
Do you have any idea why it's fine when used with SetDlgItemText but not with the resource editor?

Copyright symbol is a single byte character and doesn't make any problem. Also I can just copy and paste it without using the escaping you suggested.
I've said, check the code page set for the resource file.
The standard page is 1252 - English. I think, if you will set it in your project, it will work too.
Extended characters (from 128) are different for different code pages.

I do not use the resource editor for GUI. Maybe, only for small test applications.
Localization is a very long story. If you wish you can read everything yourself from the source documents:
MSDN. Developing International Software
http://msdn.microsoft.com/en-us/library/cc307362.aspx