Hi people.
I was wondering, is there a way to display UNICODE characters using VB?
Printable View
Hi people.
I was wondering, is there a way to display UNICODE characters using VB?
Like DBCS Characters you mean?
I'm not sure what DBCS is... :(
DBCS is Double Byte Character Set, Which include the sub sets for Japnese, Chinese, Korean etc. They are 16 bit like unicode but the coding is different, because of this a system that natively supports unicode runs DBCS 'better'.
I just thought you might have been asking for this reason...
Some languages, like Japanese, Chinese, Korean, Hebrew, etc. have an entire set of letters, and then accent marks. Since there's the English letter set, and then the other language letter set (which replaces the English accent marks, ASCII characters 224-250), the system has no room for the other language accent marks. :rolleyes:
So Microsoft decided to stick them in the 2nd byte for the characters in the DBCS system. :)
Sc0rp: The answer is, if your operating system is a language enabled/localized version of Windows, any control will automatically support Unicode for that language.
(If we're talking about the same thing here... ;))
Also try messing with the StrConv function:
Code:' Mess with this:
Text1.Text = StrConv(Text1.Text, vbUnicode)
' Or with this:
Text1.Text = StrConv(Text1.Text, vbFromUnicode)
The above post is incorrect. I can guarantee that the regular text box control doesn't support unicode. You must instead use a Forms 2.0 text box. The following are instruction that I wrote to someone else for exactly this problem(note: if u don't have win nt, u must find a different path to the language packs on your Windows CD):
The default TextBox control(and all the other default controls) in Visual Basic are unable to interpret the double-byte characters of Unicode. Therefore you must switch your textbox (or other control) to the Microsoft Forms 2.0 equivalent. Below are the steps you need to take in order for Visual Basic to properly display Unicode characters.
1. Install the language pack you need.
a. Navigate to the "Langpack" directory on your NT 4.0 CD.
b. Right click on the appropiate *.inf file of the language that you need and select the install option
2. Install the Forms 2.0 ActiveX controls
a. Open your VB project
b. Goto the "Project" menu and select "components"
c. In the "Controls" tab of the components dialog box, check the "Microsoft Forms 2.0 Object Library"
3. In your toolbox where all your regular controls are displayed you will now see a set of controls from the Forms 2.0 component you just added.
a. Place a Forms 2.0 textbox control in your project (Not a regular textbox!)
b. Set the "Font" property of the textbox to match the language you are going to display. This font was installed along with the Unicode table when you installed the *.inf file. (E.G., MingLiu is the name of the font for Tchinese.inf)
c. Pass the unicode string into the textbox at run-time and you're all set!
Jason Romajas
Paul282, Yonatan: Yeap, that's what I'm talking about.
Yonatan: I want to DISPLAY characters in Unicode.
kl899: Thanks
kl899,
You're a legend! Under win2k I've gotten kanji into the text boxes but only via using the API to fiddle with the clipboard output, I'm dealing with DBCS all the time and thought I knew all the tricks of the trade but I hadn't heard of the forms 2.0...
I'll definately look into this.