Connecting Tech Pros Worldwide Forums | Help | Site Map

Convert Byte Array to string

Prachi
Guest
 
Posts: n/a
#1: Jul 19 '05
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.

Evertjan.
Guest
 
Posts: n/a
#2: Jul 19 '05

re: Convert Byte Array to string


Prachi wrote on 04 nov 2003 in microsoft.public.inetserver.asp.general:
[color=blue]
> 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.[/color]

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)
Prachi R
Guest
 
Posts: n/a
#3: Jul 19 '05

re: Convert Byte Array to string




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!
Evertjan.
Guest
 
Posts: n/a
#4: Jul 19 '05

re: Convert Byte Array to string


Wrote ..[color=blue][color=green]
> > But when the binary data contains some Japanese characters the
> > resultant string gets corrupted.[/color]
> 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 ?[/color]

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

So they do not exist in a byte string.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Closed Thread


Similar ASP / Active Server Pages bytes