citrusmoose Posted October 25, 2004 Share Posted October 25, 2004 Alright, so I'm working in C++. I've defined _UNICODE and imported the tchar class. I basically want to convert the actual hexcode of a character and place it into a wchar_t string say '30A0' from the Katakana character set so I can output it onto the screen. How would I go about doing this? Link to comment Share on other sites More sharing options...
0 Andareed Posted October 25, 2004 Share Posted October 25, 2004 wchar_t wcMyChar = 0x30A0; wchar_t* pwcMyChar = L"\x30A0\x0000"; You can generally treat unicode chars the same way as ansi chars, with a few exceptions. Link to comment Share on other sites More sharing options...
0 citrusmoose Posted October 26, 2004 Author Share Posted October 26, 2004 how would i print wcMyChar out to the screen (command prompt)? all i get is the number in decimal if i use cout. Link to comment Share on other sites More sharing options...
0 Andareed Posted October 26, 2004 Share Posted October 26, 2004 Use wcout or wprintf. Link to comment Share on other sites More sharing options...
0 citrusmoose Posted October 26, 2004 Author Share Posted October 26, 2004 btw i'm using dev-c++ after including iostream, it still says wcout is undeclared and won't compile. using wprintf, it compiles fine, but it does't print out anything to the screen. i'm working on a school computer and it has come to my attention that it probably doesn't have support for my language installed so that's prolly the reason for wprintf not working, but i still would like to know my problem with wcout and i'll try working on it at home. thanks for the help so far. Link to comment Share on other sites More sharing options...
0 Andareed Posted October 26, 2004 Share Posted October 26, 2004 I don't belive that the w* functions are formally standarized, so wprintf and wcout may not be present in all compilers or platforms. Link to comment Share on other sites More sharing options...
0 citrusmoose Posted October 27, 2004 Author Share Posted October 27, 2004 alright thanks Link to comment Share on other sites More sharing options...
Question
citrusmoose
Alright, so I'm working in C++.
I've defined _UNICODE and imported the tchar class.
I basically want to convert the actual hexcode of a character and place it into a wchar_t string say '30A0' from the Katakana character set so I can output it onto the screen.
How would I go about doing this?
Link to comment
Share on other sites
6 answers to this question
Recommended Posts