Yes, I have Googled and Searched the forum for this.
I am reading a title from a file into a character array and now I want to set the window title but I can't... My current code puts a "??????????????????#0.02" into the caption:
wchar_t wtitle[128];
swprintf(wtitle, 128, L"%s%s", title, PSS4_VERSION);
If someone can please explain to me how to convert the character array title into a wide character array, that would be great! Thanks~ John DiSanti
Forgot to say: I did debug it and it is loading the text from the file flawlessly, the swprintf is the problem.
________
Growing Marijuana
Converting char to wchar_t.
Converting char to wchar_t.
Last edited by disanti on Tue Feb 22, 2011 8:09 am, edited 1 time in total.
I think swprintf expects string arguments to be wide as well.
Search the http://www.gamedev.net forums. There's almost certainly something there.
Search the http://www.gamedev.net forums. There's almost certainly something there.
-
- Posts: 360
- Joined: Tue Feb 10, 2004 2:20 am
- Location: Lubbock, TX
The first search in google for "C++ converting char to wchar_t" pulls up several usuaful sites about using the wctob() function
here is one of them:
http://www.mkssoftware.com/docs/man3/wctob.3.asp
here is one of them:
http://www.mkssoftware.com/docs/man3/wctob.3.asp
@thesmileman: That function is to convert a single byte wchar_t into a char... That is completely useless for my needs but thanks for looking!
________
Knee Problems Advice
________
Knee Problems Advice
Last edited by disanti on Tue Feb 22, 2011 8:09 am, edited 1 time in total.
That function appears to be Windows only, this is a Windows and Linux game.
________
Free gift cards
________
Free gift cards
Last edited by disanti on Thu Feb 24, 2011 10:26 am, edited 1 time in total.