473,385 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 17048
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Gator | last post by:
Hi All, Basically my situation is this, I have a server implemented in C++, unmanaged code, using proprietery protocol over TCP/IP to communicate with the cilent(c++ also). Now, I am implementing...
2
by: Jim H | last post by:
I am getting binary data form a database binary(8). I am copying it to a byte array byte. I need to covert this to a number, ulong, so I can write it to a string in hex format. Any idea on how...
4
by: Dan | last post by:
I need to convert a byte array to a string in order to upload a binary file with an httpWebRequest. What's the most efficient way to do such a conversion?
2
by: Dave | last post by:
Hi, I'm trying to convert a byte array to string --This works... System.BitConverter.ToString(bytes) "EB-55-79-20-18-B2-76-4D-85-0A-93-6B-97-33-31-B8" --This doesn't, but returns...
5
by: Terry Olsen | last post by:
Looking for info on how to convert a byte array to a string, and string to byte array. Thanks.
14
by: Charles Law | last post by:
I thought this had come up before, but I now cannot find it. I have a byte array, such as Dim a() As Byte = {1, 2, 3, 4} I want to convert this to an Int32 = 01020304 (hex). If I use...
6
by: moondaddy | last post by:
I'm writing an app in vb.net 1.1 and need to convert a byte array into a string, and then from a string back to a byte array. for example Private mByte() as New Byte(4){11,22,33,44} Now how...
7
by: EOS | last post by:
Hi, I would like to ask on how to convert array of bytes, Byte into String? I tried StringIwant = System.Convert.ToString(byteData); but it actually return "System.Byte" rather than convert...
0
by: Sergei Shelukhin | last post by:
Hi. I receive a byte array that contains utf-16 string (with a lot of \0 characters :)) from a legacy system that holds some data that is changed elsewhere. How do I convert it to an actual utf-16...
18
by: MrVS | last post by:
Hi, I have a C++ CLR class method that takes System::Byte *b as parameter argument. I want the CSharp caller pass a byte * to this function. But in the CSharp prorgram, I only managed to create a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.