469,353 Members | 2,066 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,353 developers. It's quick & easy.

Convert Byte Array to string

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.
Jul 19 '05 #1
3 16391
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 ?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #2


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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3
Wrote ..
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 ?


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.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Dan | last post: by
2 posts views Thread by Dave | last post: by
5 posts views Thread by Terry Olsen | last post: by
7 posts views Thread by EOS | last post: by
reply views Thread by Sergei Shelukhin | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.