Solved

Problem with VB reading Chinese/Korean International Language

Posted on 2003-10-29
11
2,740 Views
Last Modified: 2013-12-25
I have read about Internationalization and need some help.  I developed a client/server application in VB6.  The application handles customer registration and a queston/answer survey.  The label captions for the form and the questions and answers for the survey are all stored in an Access (Office XP) database.  The original application was developed for English and Spanish and since both languages are Western Latin characters, there was no problem with the language difference.  However, now the client wants the application to work in China and Korea.  I have read several Q/A in experts-exchange as well as MSDN regarding working with Internationalization.  I have added the Traditional Chinese, Simplified Chinese and Korean in the Control Panel/Regional and Languages Settings and installed the languages in MS Office.  Now the problem I have is VB will not read the language.  Like I have mentioned, the data is stored in the MS Access and the language is read and maintained in the database, but when I try to extract the data from the database, it either returns ???? or characters which do not closely resemble the Chinese characters in the database.  I have tried using a resource file, but get the same issue when pasting the data into the resource file.  I have even tried hard coding the data in the app, but again getting the same results.  I do not have a Chinese character keyboard, but do have the text saved in the database.  Any help you can provide to assisting me getting through this would be greatly appreciated.  

PJ
0
Comment
Question by:houmerlin
11 Comments
 
LVL 29

Expert Comment

by:leonstryker
ID: 9644067
0
 

Author Comment

by:houmerlin
ID: 9645129
Hi Leon,

I have read the links you have mentioned.  

I have tried several things now, including setting the font of the labels to MingLiu -> Subset Chinese Big5.  I have tried loading the values into an INI file and in the INI files the values are properly stored, but when VB tries to read the values I notices walking through the code, the API call brings back an incorrect string, I believe a non Unicode comforming string, like you have mentioned perhaps an ASCII.  Any recommendations on what to do from here?  

In some of the articles you posted people mentioned various things like using MS Form 2.0, but if VB does not properly bring over the value from the INI, using the form would be useless, right?
0
 
LVL 29

Expert Comment

by:leonstryker
ID: 9645273
MS Form 2.0 is not the answer, it is non-distributable and buggy to boot.  You should not bring the text into a INI file as well, since things will be changed by it.  The challenge for you is to find a font which contains the characters you are looking for as the 0-255 ASCII values.  If you can find it you can then build a translation function like we did for Greek and Russian in the links above.

I know it is not easy, but I have yet to find a better solution.

Leon
0
 

Author Comment

by:houmerlin
ID: 9646556
Ok so here is another twist for this.  I have an admin console, one button is open registration forms for clients to fill out the information.  Another button just below it is a button to open a form with a MSHFlexGrid object on the form.  I inadvertantly clicked on the button to view the form with the Flex Grid and the data displays perfectly in Chinese.  So now I am just a little confused to say the least.
0
 
LVL 29

Accepted Solution

by:
leonstryker earned 250 total points
ID: 9646612
MSHFlexGrid may have unicode support built in, something that can not be said for other standard controls.  In such a case you may try to use it instead of labels and text boxes.  Kind of strange, but if it works, go for it.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 32

Assisted Solution

by:bhess1
bhess1 earned 250 total points
ID: 9646967
VB6 Controls are, unfortunately, not Unicode enabled, meaning that they can only display characters that are defined in the ANSI character set of the client machine where the app is running.

To see if this is the case, try dumping out the hex representation of one of the strings that you retrieved (*before* you try to put the string in a textbox or label).  Here's a function that will return a string version of the hex representation of a Unicode string.  If the output doesn't make any sense to you, then there may be other issues.  If you get anything but a series of 0x3F's, the data is actually not question marks at that point, which means that it must be getting converted to question marks at some later point in the app.

Since the VB Controls display Question marks when they cannot show the Unicode characters correctly, that would be my suspicion as to when the conversion is happening :)

Function StrToHex (S As String) As String
' Returns a hexadecimal representation of the input string
Dim Temp, OutStr, I
If VarType(S) <> 8 Then
    StrToHex = S
Else
    Temp = ""
    OutStr = ""
    For I = 1 To LenB(S)
       Temp = Hex(AscB(MidB(S, I, 1)))
       If Len(Temp) = 1 Then Temp = "0" & Temp
       OutStr = OutStr & Temp
   Next
   StrToHex = OutStr
End If
End Function
0
 

Expert Comment

by:ami2003
ID: 9655942
Hi,
It 's a little more difficult when u try access font unicode in VB6 or VC6. Why don't you try to learn VB.Net or C#.NET. Life will be alright... All of your trouble will be ok...
Bye and hope you feel my suggestion is correct
0
 
LVL 29

Expert Comment

by:leonstryker
ID: 9657107
ami2003

Sorry to tell you this but VB.NET has the same problem
0
 
LVL 8

Expert Comment

by:MYLim
ID: 9748750
Have you try to install "chinese star 2000" or "NJSTAR" ?

0
 
LVL 1

Expert Comment

by:ayufans
ID: 10458325
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Points split between leonstryker and bhess1

Please leave any comments here within the next four days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

ayufans
Cleanup Volunteer
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now