Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to convert ASCII to Unicode.

Status
Not open for further replies.

Rationalist

Programmer
May 31, 2005
21
CA
Hi, I'm trying to convert a Ascii string to Unicode, but I fail to do so.

Dim bbb As Byte = Byte.Parse(StringTobeConverted)

System.Text.ASCIIEncoding.Convert(System.Text.Encoding.ASCII, System.Text.Encoding.UTF8, bbb)

And I get the following confusing error:

Value of type 'Byte' cannot be converted to '1-dimensional array of Byte'.

Thanks
 
I think you need this

Code:
Dim bbb() As Byte = Byte.Parse(StringTobeConverted)

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
that doesn't work

Error:
(307): Value of type 'Byte' cannot be converted to '1-dimensional array of Byte'.
 
The encoding mathod needs a byte array
Code:
Dim b As Byte = Byte.Parse("123")
Dim bb(1) As Byte
bb(0) = b
System.Text.ASCIIEncoding.Convert(System.Text.Encoding.ASCII, System.Text.Encoding.UTF8, bb)

Sweep
...if it works dont mess with it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top