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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mangling Simplified Chinese characters in a combo box

Status
Not open for further replies.

RGeorg

Programmer
Feb 1, 2007
6
US
I have an urgent problem on my hands. I looked through the old posts but found nothing.
When I build a list of names (WCHAR) in a ComboBox that include Simplified Chinese, the drop-down displays the chinese characters correctly. However when I select an item containing the said characters it displays ??? for the first three characters (the fourth is correct), although the codes per each character in debug show the correct value. Writing the string on CBN_SELENDOK to a static text control yields the expected result (with some font tweaking though using mostly DONT_CARE). Writing it to an edit box or a list box yet again shows the ??? for the first three characters.
I am working in VC++ 6.0 Win32.
Anyone encountered something similar???
Any input is greatly appreciated.

 
Issue was resolved. The file we received from the Chinese customer had Korean characters that won't display correctly (or at all "???"):) in Chinese locale.
Thanks for reading.
 
It really depends on which character sets you have installed. If everything in your dialogs usess Arial MS Unicode, it will display anything from Chinese to Devengari scripts. Chinese are very fond of User Defined Characters which is a right pain to display.

Note that the Chinese don't alway have everything in Simplified. They may tell you it is Simplified but old habits die hard and they occassionally switch back to Traditional. Windows is really nasty in that sense - it automatically switches both the font and the character set without telling you.

Spelling errors are quite common like in English (roes, rows, rose, rhos - same sound, about 10 different meanings).

Also, as I've discovered, hardly anyone knows the characters for 10^12, 10^16, 10^20 etc. Just like asking a layman how many zeros in a long base quadrillion.
 
Thanks, I think I'm in for a lot more surprises when other customer files show up.:)
I have installed Chinese (Simplified and Traditional) and Korean. I set the font for the combo box in question to a font with most DONT_CARE parameters and I get a lot less squares (characters incompatible with the currently selected font) and the rest uses MS Sans Serif.
On another note, we had to create our own version of wcstombs because it didn't always work. I don't know if GB2312-80 is really 100% 2 BYTE (like Unicode) or they are using a mix of character sets as you mentioned?
Thank you for your reply.

 
Microsoft's Unicode is 100% 2byte. Unix/Linux unicode is 4 byte. I think GB2312 (Simplified) is 100% 2 byte, so is big-5 (Traditional).

The Japanese Kanji is a mix of Traditional and Simplified.

Korean Hanja is also some form of Chinese characters. Hangul is the traditional Korean script.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top