Results 1 to 2 of 2

Thread: Chinese String?

  1. #1

    Thread Starter
    Fanatic Member Illspirit's Avatar
    Join Date
    Mar 2001
    Location
    Blackpool, England
    Posts
    815

    Chinese String?

    Hey,

    I have written a program and it can be translated. There is a text file with numbered lines. This file is loaded and split into an array of each line. The caption of each command button, label, etc is set to a specific line using a function when the form/usercontrol is initialized. I have some users asking if it is possible to add support for chinese characters.

    How can I load unicode strings from a text file, and set them to be a function result, so they then become the control's caption?
    Illspirit - [email protected]

    SmartBarXP Lead Developer
    SmartBarXP - The leading desktop sidebar application for Microsoft Windows XP

  2. #2
    Addicted Member
    Join Date
    Jul 2002
    Posts
    234
    Reading text into VB in Unicode is easy enough since VB uses Unicode internally for its string. However, you won't be able to load these strings into the default VB controls. Microsoft's default controls only support ANSI text, so the Unicode will never display correctly. To get something like this to work, you can use Microsoft's Forms 2 Object (though you cannot distribute it), or you can purchase a 3rd party control that will allow you to print the data. Actually, just a minute.....I have a book by Michael Kaplan called Internationalization with Visual Basic. In Chapter 8, Handling VB Forms and Formats, there is a section on extending the default VB controls. I'm attaching a project that demonstrates how one would extend the label control to include unicode text. I tend to forget about this book, but it is very good and one that I consult a lot when I'm doing projects that require localization.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width