My huge project need few message box in UNICODE without UNICODE compilation?
I have a huge old project. Converting it to total UNICODE compilation is very difficult. I need few menus and Messages boxes in UNICODE (Need in Japanese).
How to achive this without UNICODE compilation?
Is this possible?
There a some unicode functions that you can call directly to its unicode implementation.
For example TextOutW()
There are more, probably MessageBoxW is one of them. However if you are running under Win 9x or Win Me you will need the aid of the Microsoft Layer for Unicode to run that functions. If you are running under W2000 or XP you won't need the layer for unicode and you can call all the unicode functions directly.
TextOutW is the unique function I know that does not need the MLU. I think there are more I have seen them somewhere I can't remember now.
Thanks for your replies. But... Kindly look at the four line code.
First, thanks a lot for the replies. TextOutW(..) prints somthing but not UNICODE. (I tried with some japanese characters. I have already installed japanese characters and its working on IE)
I tried the following code to test it for the first few characters of [Ã¥´ëºñÀÌ ÀÖÀ»±î¿ä]
Since you are using MFC you can create a CFont object and select it with the DC's SelectObject() function. I think you should include a valid japanese character set in the definition of the font.
What font? Select a japanese font if you have "MS Gothic" and "MS Mincho" are examples.
Really are those characters valid unicode japanese characters and not other codification?
Can you tell me what do you want to write in japanese to check the wchar_t values?
When I visited a japanese page, my IE automatically loaded japanese in to my PC and could see the page in japanese.
I copied these lines from the webpage to my outlook as below
then viewed the HTML of this code as below
I converted first three characters in to hex (Ex. 52293 to 0xCC45 )
So, I am sure these are japanese unicode bytes.
Then I tried to print three of these characters. Please see FONT face is "Times New Roman" in my html source. But, still I see japanese.
I think these code lines can show you how to use TextOutW with japanese unicode text. The font I have used is "Arial unicode MS" which supports japanese text. You can use any other font wich supports japanese text.
Note that in CreateFont the charset is set to 512 wich is SHIFTJIS_CHARSET, however I have tested with other values like DEFAULT_CHARSET and I continue succesfuly viewing the japanese text.
MSDN suggest that the charset must be consistent with the facename. I'm not sure about the importance of this parameter respect the final result.
I don't know why I have Arial Unicode, maybe it was installed by some application.
Some Japanese fonts are installed when you install japanese support for your computer, for example if you download the Japanese Global IME from microsoft home page, the "MS Gothic" and "MS Mincho" fonts are installed.
You can also search internet and try to find some japanese fonts. I think there are some free japanese fonts somewhere.
I think Arial Unicode MS is installed with a full install of Internet Explorer + when you add non-latin languages to your set of locales.
I think (although I may be wrong) it comes as standard with W2K & XP but not on 98.
That's my font of preference too as it covers just about all unicode ranges pretty thoroughly, although isn't as pretty in Arabic as Arial for instance.
However, it is HUGE (23Mb) so I can't post it.
You could try searching for it using google et al and get it that way.
Bookmarks