Convert Byte Array to string

P

Prachi

I want to convert the binary data to string.
I tried doing the same using following peace of code

Function SimpleBinaryToString(Binary)
Dim I, S
For I = 1 To LenB(Binary)
S = S & Chr(AscB(MidB(Binary, I, 1)))
Next
SimpleBinaryToString = S
End Function

It works fine when the data is English.
But when the binary data contains some Japanese characters the
resultant string gets corrupted.
Can someone help.
Thanks in advance.
 
E

Evertjan.

Prachi wrote on 04 nov 2003 in microsoft.public.inetserver.asp.general:
I want to convert the binary data to string.
I tried doing the same using following peace of code

Function SimpleBinaryToString(Binary)
Dim I, S
For I = 1 To LenB(Binary)
S = S & Chr(AscB(MidB(Binary, I, 1)))
Next
SimpleBinaryToString = S
End Function

It works fine when the data is English.
But when the binary data contains some Japanese characters the
resultant string gets corrupted.

I do not think there is such a thing as a Japanese character in a binary
string.

Is there a Japanese equivalent to 8bit(!) ascii ?
 
P

Prachi R

Japanese characters are mostly double byte characters.
The ASCII code of all these characters is generally greater than 255
 
E

Evertjan.

Wrote ..
I do not think there is such a thing as a Japanese character in a binary
string.
Is there a Japanese equivalent to 8bit(!) ascii ?

Prachi R wrote on 05 nov 2003 in microsoft.public.inetserver.asp.general:
Japanese characters are mostly double byte characters.
The ASCII code of all these characters is generally greater than 255

So they do not exist in a byte string.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top