Link to home
Start Free TrialLog in
Avatar of csharp_learner
csharp_learnerFlag for Singapore

asked on

VB Form showing indian and chinese characters

Hi,

I am using VB 6.5 integrating with other systems.
Recently they have passed me a string into the VB form to display english chinese and indain characters.

But the form only shows english letters for chinese and indian it shows ??? instead of the actual characters. How can I make the characters display on the form?

*PS: i am working on xp os, vb script.
Avatar of Cenjoy100
Cenjoy100
Flag of India image

Its must be because an encoding issue.
csharp, still interested in this question?

Can you view indian chars in Notepad on your dev PC?
Avatar of csharp_learner

ASKER

Sorry for the late reply,

No I can't indain or chinese chars in the PC.
Try going to your Control Panel -> Regional and Language -> Languages.  Somewhere there should be an option to install new languages, or even a checkbox for 'Install files for complex scripts and right-to-left languages'.

More help here:
http://www.bharatdarshan.co.nz/hindi_font_downloads.html
Hi,

As attached the regional settings are already set but i still see distorted chars in the message box.

The code that was used to populate the form is as follow:

Public Sub ShowMsg(sCustomData As String)
  On Error Resume Next
  Dim sMessage As String

    strSplit = Split(sCustomData, ",")

    sMessage = strSplit(4)
 
    TISViewForm.ViewText.Text = sMessage
End Sub


Any help is appreciated...
regional1.PNG
regional2.PNG
regional.PNG
display.PNG
ASKER CERTIFIED SOLUTION
Avatar of aikimark
aikimark
Flag of United States of America 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
Thanks for your reply,

The string is passed to me by another user.
I don't understand what do you mean by "only displaying this non-English text in labels"
One way to implement localization is to change the text displayed in labels on your form and menu text.  The other (user input) controls would not change.  I wondered if your language changes would affect any controls other than labels.
sorry aikimark, I don't get what you mean.
can you explain it in more detail?

Thanks
Answer me this...What kinds of controls need to display these strings?
just a display form as attached in display.PNG
can anyone help?
I've requested that this question be deleted for the following reason:

The question has either no comments or not enough useful information to be called an "answer".
@Martin

This is not an inactive question.  I am interrupting your close action.
@csharp_learner

>>can anyone help?
The experts have asked you questions and made suggestions.  You need to continue your participation in the problem-solution process
gladly, hoe can we move forward?
* reread the comments and answer any questions the experts have posted.
Hi aikimark,

This is the vb code i am using

Public Sub ShowMessage(DataComingIn As String)
  On Error Resume Next
  Dim sMessage As String
  Dim strSplit() As String

    strSplit = Split(DataComingIn, ",")
   
    sMessage = strSplit(4)

    DisplayForm.ViewText.Text = sMessage
   
    DisplayForm.Show

End Sub


The parameter "DataComingIn" is passed to me from an external source.(And from what i got to know today, it's in UTF-8 format). The string is supposed to contain all the 4 chracters of the 4 language inside. At the end of the code it will show a Form displaying the string passed by the parameter "DataComingIn".
form.PNG
So, you're trying to display different language characters in a single textbox at the same time?

Please do the following:
1. Convert your DataComingIn string into a byte array, using the StrConv() function
2. Iterate the values of the byte array
3. Post the byte values back here
Sorry for the late reply, as advised i have used the following codes and attached the resutls of the bytes.


    x = StrConv(sMessage, vbFromUnicode)
    For i = 0 To UBound(x)
    MsgBox x(i)
    Next
message.txt
This is a mixture of ASCII and unicode characters.  It appears to be space-delimited

v205 Default Message UNICODE Satu

Where UNICODE are the characters that you are having problems with.  Do you know anything about the desired rendering of the unicode characters in the program?  That is, how do you know whether you are receiving Indian or Chinese characters?
One more thing to note from my analysis: There are an odd number of bytes in the UNICODE string.

@csharp_learner

Do you have a screen shot of how this string should be rendered?
The byte array conversion might not show us the actual unicode.  Please paste the content of the Immediate Window after running this code snippet.
    For i = 0 To UBound(x)
    debug.print i, AscW(Mid$(sMessage, i,1))
    Next

Open in new window

This module have been put on hold by my boss hence development work is stopped.
Thanks for the help.