Solved

Problem with VB reading Chinese/Korean International Language

Posted on 2003-10-29
11
2,783 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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
 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

734 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