Unicode print problem

Sep 12, 2014 at 2:07pm
I am writing a Win32 application which should print some unicode characters on an edit control using unicode character codes(i.e. '\u1020').

It works for common alphabet carachters, but when I try to print mathematicals symbol it only show a "?" on the edit control.

I don't think it's a problem of the system because other programs, like Word,
recognize all unicode codes. Has anyone any idea?
Last edited on Sep 12, 2014 at 2:08pm
Sep 12, 2014 at 3:26pm
You would need to use a font that can support the characters, firstly.

How are you setting the edit control's text? What function/message?
Sep 12, 2014 at 3:27pm
Why are you trying to use the character map directly like that? Is there a limitation on your resource compiler or something? As of x11 'char32_t' exists specifically to accommodate Unicode characters.
Sep 12, 2014 at 3:55pm
Reply to Veltas:

I am setting the edit control text with SetWindowTextW() function.

Reply to Computergeek01:

I am not compiling with C++11.
Sep 12, 2014 at 4:58pm
OK, you can still use a 'wchar_t' or 'std::wstring' the only difference is that they don't specify the character set.

That question mark is a filler for when Windows can't resolve the text that you fed it, this happens when you pass 1-byte ASCII characters where 2-byte characters are being read due to the spacing of the characters in memory. The value of the ASCII character is read in as the high order byte but then where the system expects a low order byte there is a null.
Sep 13, 2014 at 7:06pm
I changed the fonts, and put one that works on Word with mathematical symbol, but still the control editor print a "?".
Topic archived. No new replies allowed.