Date: | July 15, 2004 / year-entry #281 |
Tags: | code |
Orig Link: | https://blogs.msdn.microsoft.com/oldnewthing/20040715-00/?p=38433 |
Comments: | 9 |
Summary: | I answered this comment directly, but it deserves reiteration with wider visibility. If you don't #define UNICODE, you get ANSI by default. If you want to see characters beyond the boring 7-bit ASCII, make sure you are using a font that can display those characters. I am assuming a level of competence where issues like... |
I answered this comment directly, but it deserves reiteration with wider visibility. If you don't #define UNICODE, you get ANSI by default. If you want to see characters beyond the boring 7-bit ASCII, make sure you are using a font that can display those characters. I am assuming a level of competence where issues like this go without saying, so that I can dig into the more advanced topics without having to explain all the basics, but I have to accept that people of all levels of programming experience read my stuff. But the second part raises an advanced question: How do you find a font that can display the characters you want? What if the characters can come from a source outside your control? We'll look at this tomorrow. |
Comments (9)
Comments are closed. |
Also what about "#define _UNICODE"?
_UNICODE is for the C runtime’s TCHAR support, i.e. _tcscpy (–> wcscpy vs strcpy). This is distinct from UNICODE, which turns, say, CreateWindowEx into CreateWindowExW instead of CreateWindowExA.
If one were to say just call the W versions of functions and structures explicitly, would there be a real reason to define UNICODE ?
Just curious, even though typing W all the time is a pain, it could allow a project to have a steady migration over to unicode.
Jack
Yes you can switch over gradually by manually inserting W’s and L’s on a per-call basis.
Where does Microsoft document this?
It seems like the first rule of _UNICODE is that you don’t talk about _UNICODE. If you don’t know about it in the first place, it’s awfully hard to figure it all out from Microsoft’s documentation.
??? If it’s a secret it’s a really badly kept one. #1 hit for _UNICODE on MSDN is http://msdn.microsoft.com/library/en-us/vccore/html/_core_generic.2d.text_mappings_in_tchar..h.asp
That’s the way from “I know there is a conditional named _UNICODE” to “I know what _UNICODE does”. Though, the inverse is also easy; the page about strcpy mentions both _UNICODE and _MBCS.
http://weblogs.asp.net/oldnewthing/archive/2004/05/31/144893.aspx
Use Arial Unicode for all your font needs :)