PDA

Click to See Complete Forum and Search --> : [VB] Unicode


Merri
Dec 30th, 2003, 10:24 AM
'convert to UTF-16
For A = 1 To Len(Temp) Step 2
Text = Text & ChrW(Asc(Mid$(Temp, A, 1)) + Asc(Mid$(Temp, A + 1, 1)) * 256)
Next A


Yup. If someone knows a better way, you'll become my hero. I want to make optimal code for the class module I'm working with, and this is the weakest code there atm.

CornedBee
Jan 22nd, 2004, 11:28 AM
Write a DLL in C. VB's strings are UTF-16 internally, but accessing them that way...


You could try a fixed length string (length = Len(Temp) / 2), and the CopyMemory API call. Quite risky though.