Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

in- and output of japanese characters 1

Status
Not open for further replies.

branko

Programmer
Mar 19, 2002
49
SI
Hi,

I have written a program (among other things) takes text as input from a dialog. This text is saved and displayed in a view. Now I am trying to make my program work with unicode characters. To be precise: I use the japanese IME on an English version of Windows 2k. In a sample program I have 2 edit boxes, one for input and one for displaying, and a transfer button. The text from box one is put into a CString and this CString is displayed in box 2. I tried with CEdit and with CRichEditCtrl. I can input nice Japanese characters, but the output is just "????". I defined _UNICODE for my project. It works for the English alphabet.
Does anybody have any experience with this? Any suggestion is welcome.

Thanks in advance,

Branko

P.S. I turned on the option to display unicode characters in the debugger, but there also I see just "??"
 
I recently wrote an application as a proof of concept that handles UNICODE with MFC in 2 ways. One is dynamic resource DLLs and the other is all in code itself. There are a few steps that need to be taken before this can be done.

First and foremost... Are you running on windows 2000?

Matt
 
I recently wrote up an article on how to do this and I am waiting to hear back from Microsoft. I would be more than happy to answer any of your questions but my development of this application was done on Windows 2000. If you are on windows NT, all the info I give you may not be correct but it should be close to it.

Matt
 
Hi Matt,

I am using Windows 2000 (English version), so any help is welcome!
In an ideal world my program should also run under the other Windows versions, but I will worry about that later...
So if you can point me in the right direction that would be very nice

Thanks,

Branko
 
Ok, the first step is to install the japanese language pack

In the Control Panel - Regional Options under the General tab, there will be a list at the bottom of the dialog with check boxes. Scroll down to Japanese. If there is no check mark in the check-box to the left of Japanese, check it and click Apply. (This will require the Windows 2000 cd or Language Pack Equivalent). Once installed, you may need to reboot your system.

The next step is to set the input locale

In the Control Panel - Regional Options under the Input Locale tab there will be an Installed Input Locales section. Click Add. From the Input Locale drop down list select Japanese and for the Keyboard Layout/IME drop down box select Japanese Input System (MS-IME2000). Notice the Hot Keys for Input Locales section. There will be a list of Key Sequences. The switch between input locales key sequence should default to Left Alt+ Shift but you can set this to something else by clicking the Change Key Sequence button. Verify that your default input locale is English (the Installed Input Locale section next to English will have a check mark. If it does not, highlight it by clicking on it and click the Set as Default button)

Next, you need to set the default locale... this is just a LOCALE and will not affect how you log into your computer. It may however affect installation of programs.

In the Control Panel - Regional Options under the General tab, scroll down the list for Language Settings for the System. Highlight Japanese and click Set Default. Once done, verify it did not change your Input Locale default input language. Click OK

Now you should be set up to support japanese characters. To verify this:

Open Microsoft Word. In the sys-tray, you should see a square with EN in it. That is your current input locale (ENGLISH). Left Click on it and change the Input locale to Japanese. You will see a tool bar appear. There will be a button that has what looks to be the letter A OR there will be a pen icon in its place. Click this is choose the top most option (HIRAGANA) or in the japanese input locale you will see an H in parentases at the right of a japanese word. By typing in konnnichiha you should see ‚±‚ñ‚É‚¿‚́@appear as you type.

Most likely, tek-tips will not support the japanese characters on this site so the ‚±‚ñ‚É‚¿‚Í may just look like garbled text. In microsoft word it should look fine. You may, however, need to use a UNICODE enabled font to display the japanese characters properly.

Well, once all this is done, there are a few things you need to do with dev studio... just post when this is done.

Matt
 
Hi Matt,

I am sorry that I put you trough so much typing, I guess it was not clear from my first post that I have the Japanese input system already installed. It is working fine in Word, even in Notepad if I select a font like SimSun and save as unicode txt file.
So we can narrow the problem down to VC++ (6.0) and my application.

again, thanks

Branko
 
I would like to send you my first exe to see if you can display japanese characters. Do you mind popping up your email?

Matt
 
I am sorry for the short answer above... I have, Ironicly, been in a globalization meeting for 4 hours and then we went to lunch. The reason I asked for you email was so I could send you the app I wrote. If you can display japanese properly in this app, then your system is configured properly. If, however, you get the question marks, you are not cofigured properly. Drop me a line at

mgs@heartlab.com

if you prefer not to post your email.

Matt
 
Thanks for taking the time Matt!

what became clear from the e-mails whas that I needed to set the default in the general-tab of the regional settings to Japanese. Then everything works fine.

Branko
 
I have installed the msime for the japanese language and 98 does not even list the japanese language in the list of languages to use


Please help

heycomputerguy

 
Windows 98 is a different issue. Full unicode support was not instantiated until NT 3.1. For programming in 98, you need to investigate "the microsoft layer for unicode". I have no experience with this so I apologize for not being of assistance.

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top