View Full Version : Closed: Using Unicode
johnjasmines
06-08-2004, 09:28 AM
Can one use unicode in a visual basic application to input Latin-Extended characters in a text box? Specific characters include A with a macron above it, which is unicode 0101. I can do ascii up to 255, but the latter characters that I need I don't know how to insert because they are unicode....please help
mark007
06-08-2004, 09:51 AM
I'm sure there must be an easier way but VB actually stores strings in memory as unicode so you can create a unocode string from a byte array using this function:
Function UnicodeChar(code As Long) As String
Dim b(0 To 1) As Byte
b(0) = code \ 100
b(1) = code - b(0) * 100
UnicodeChar = b
End Function
:)
herilane
06-08-2004, 01:08 PM
Use ChrW instead of Chr:ME.Textbox1.Text = ChrW(&H101)
mark007
06-09-2004, 03:56 AM
Good spot Helen. I knew there must be a built in fucntion but I couldn't remember it off the top of my head! It was quicker to write out a new one!
;)
NateO
06-10-2004, 01:34 PM
If you're going to stack a textbox with a string, you might as well spare yourself the overhead and use the string variety of the chrw function eh.
E.g., ChrW$(257)
NateO
06-11-2004, 09:18 AM
Attached is an Example.:)
Anne Troy
06-14-2004, 09:50 AM
John: Was this helpful?
johnjasmines
06-15-2004, 02:29 PM
NO, Dreamboat...it didn't help. I found out that VB doesn't recognize Unicode directly in the textboxes....
mark007
06-15-2004, 02:58 PM
Try a richtextbox.
:)
johnjasmines
06-15-2004, 05:41 PM
You can delete the thread
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.