Link to home
Start Free TrialLog in
Avatar of software_elico
software_elico

asked on

japanese code conversion problem

Hello ,
          i have a module which displays a dialog box similar to a the groups dialog in windows XP.

Name                       Description
Administrators          Administrators have complete........
....

like the above.the module was tested in japan and they have come up with a bug that the description
side of the strings is getting transformed to japanese code conversion
like this:

Name                     Description
Administrators        ..#frfd~*76%er


.now i know this is the unicode issue,but can some one please give suggestions on how to solve my component is in visual basic 6.0.

Avatar of jimbobmcgee
jimbobmcgee
Flag of United Kingdom of Great Britain and Northern Ireland image

What are you using to show your data?  You might want to consider one of the controls in the MS-Forms 2.0 Object Library -- it comes with Office and the ActiveX Control Pad (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaxctrl/html/cpad.asp).  It is a DLL (fm20.dll) that contains some Unicode versions of some controls.

Otherwise, try the Unicode controls at http://www.cyberactivex.com/

HTH

J.
Avatar of software_elico
software_elico

ASKER

here objGrp is an object of IADsGroup.

Dim objGrp As IADsGroup
    Dim lstItem As ListItem
    'Reset the list boxex
    lstGroups.ListItems.Clear
    mobjCont.Filter = Array("Group")
    Screen.MousePointer = vbHourglass
    For Each objGrp In mobjCont
        Set lstItem = lstGroups.ListItems.Add(, , objGrp.name)
        lstItem.ListSubItems.Add , , objGrp.Description
    Next

what i dont understand is the name and Description properties are both BSTR ,then how can the name be displayed correctly and the description have japanese characters.
So the name is displaying as you would expect it to but the description is displaying as a jumble of garbage characters?

Are there Japanese characters in the name field (check in AD).  If not, that's why your name is displayed correctly.  As far as I know, the controls supplied with VB6 do not support Unicode (although VB6 strings are Unicode -- go figure!!)  

If there is even the slightest chance that you will need to display foreign characters, you will have to use the Unicode-capable controls I linked to above...

J.
*the controls supplied with VB6 do not support Unicode (although VB6 strings are Unicode -- go figure!!)*

Can i get some more information on the VB6.0 unicode support.

thanks  
Okay,
        If i download the fm20jpn.dll will it support my application which is in VB 6.0 ,to run in a japanese Windows XP operating system.i will clarify the question...

I have an application in visual basic ,say a simple application like a dialog box with a text box to display my name,the problem is when i enter a few characters in japanese ,they all become question mark characters.so if i can download the above mentioned dll or use strconv function,will it work?
Getting fm20.dll, referencing it in VB6, adding its controls to your VB toolbox and using its text box should work.  Replacing all your existing controls with their Forms 2.0 equivalent should do the trick, yes.  Be aware that some of the properties of the Forms 2.0 controls differ from the existing VB6 ones...

J.
ok,
    i think i got a unitoolbox and started running my applications.it works fine but now i cannot login to the japanese version of windows xp.
You can't log in to the Japanese version of XP since installing, or despite installing, UniToolbox?

Does the username/password for the Japanese XP contain Japanese symbols?  You may have trouble typing the characters, because of a cope page, or something...?

Just a thought,

J.
No japanese symbols.but i think they(japs) found a work around to that.
anyway i just have one last query and then i will PAQ the points to you.I have a string variable
to store  the directory path,i am sending this string to a list box list which is a unicode component.but when i read the directory path into the String variable,which does not support unicode,my characters are garbled.so basically my question is ,how can i read this dir path into a unicode string.thanks

If (lpIDList <> 0) Then
    sBuffer = Space(MAX_PATH)  //sBuffer is a String
    SHGetPathFromIDList lpIDList, sBuffer
    sBuffer = Left(sBuffer, InStr(sBuffer, vbNullChar) - 1)
  Else
    Exit Sub
  End If

  For l = 0 To lstSelectedFolder.ListCount - 1

    If (sBuffer = lstSelectedFolder.List(l)) Then
        blnFound = True
        Exit For
    End If

  Next l
    If (blnFound = False) Then
        lstSelectedFolder.AddItem (sBuffer)
   
ASKER CERTIFIED SOLUTION
Avatar of jimbobmcgee
jimbobmcgee
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If it doesn't return the length, you'll have to poll the bytes looking for (two adjacent) null byte(s)...

J.