RESOLVED: Mangling Simplified Chinese in a ComboBox

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 correctly. However when I select an item containing the said characters it displays for the first characters, 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). Writing it to an edit box or a list box yet again shows the .
I am working in VC++ 6.0 Win32.
Anyone encountered something similar
Any input is greatly appreciated.



Answer this question

RESOLVED: Mangling Simplified Chinese in a ComboBox

  • Nikraz

    Can you post some code, to understand your problem better
  • Johan Cyprich

    The file we received from the Chinese customer was with Korean characters. They won't display correctly (if at all - that's why I was getting " ")in Chinese locale

    Thanks for replying.


  • AVVIT

    //This is the code I inserted to trap CBN_SELENDOK to examine the content of the string. The codes for the characters are correct

    // Again the chinese characters show correctly in the drop-down combo box, but after the item is highlighted the first

    // three characters show up as and the fourth is the correct chinese character.

    switch(HIWORD(wParam))
    {
         case CBN_SELENDOK:

        if(CB_ERR != (iRc = SendMessage(GetDlgItem(hDlg, IDC_KB_LIST), CB_GETCURSEL, 0, 0)))
        { 

          //wcDisplay is a WCHAR string

          //IDC_KB_STATUS -a static text, displays the CORRECT string (font is set as DONT_CARE), in the following format (chinese character) (chinese character) (chinese character) (chinese character) PC 400.....

         SetDlgItemTextW(hDlg, IDC_KB_STATUS, wcDisplay);

          //IDC_EDIT1 is an edit box which displays the same INCORRECT string as IDC_KB_LIST (the combo box, font is set as DONT_CARE),  in the following format (chinese character) PC 400....

          SetDlgItemTextW(hDlg, IDC_EDIT1, wcDisplay);
         }

         break;

    }

    //Setting the font as something other than DONT_CARE yields squares for the first three (problem) characters


  • RESOLVED: Mangling Simplified Chinese in a ComboBox