-
Unicode problems
Lately I've been trying to adopt to Unicode. So im using LPSTR LPSWSTR and what not.
What I'm having trouble with is sprintf, as far as i know it only works with char* and they are 1 byte in size, where as UNICODE characters are 2 bytes.
Is there a function that'll do the same thing as sprintf that works with wchar_ts?
EDIT:
swprintf... wow that was hard to figure out.
I'm sorry for the useless post.
-
You can find a list of the wchar functions in <wchar.h>. Also if do a search for a funciton on msdn (function msdn in your favourite search engine), it will list the corresponding wide character version. Finally, you may be interested in <tchar.h>. This has macros that you can use with TCHARs. These resolve to wchar_t, if UNICODE and _UNICODE are defined, and normal char otherwise.
I have to warn you, that when it comes to outputting or inputting strings to/from the console or a file, the C run-time unicode functions can be a mess.