Q. How do I compile my Visual Studio project as Unicode?
A. Simple! Just follow
the white rabbit this guide
Short-short story: define
_UNICODE and change the entry point to
And yes, you need both defines, because
UNICODE affects Windows API (things like
_UNICODE affects the C Runtime (things like
In Visual Studio 6 you really have to do the above changes “by hand,” but in the newer versions you just select the option in a menu.
Why put this together? Because the question gets asked, and is so much easier to point someone to a web page, instead of typing the whole story again and again
Visual Studio 6
_MBCS was defined, deleted it).
Then set the entry to
Visual Studio 2005 (and 2003)
Here you have the option when you create the application using the wizard (and in Visual Studio 2005 “Use Unicode libraries” it checked by default).
But if you missed it, or the project is older, it is still easy to change it.
Just go to project properties and change the “Character Set” option:
It just makes life easy, because in the belly of the beast the same old trick is happening.
The defines are done:
and the entry point is set:
Done! But this was the easy part.
How to get everything to compile properly after these changes, now that, is real work