Newbie question about string handling

G

Guest

Hi,

I have a statement in my code that looks like the following ::

intPort = 8080;
chr1 = (char)(128);
chr2 = (char)(143);

str1 = chr1.ToString() + chr1.ToString();

MySocket.Send(str1, "172.16.100.103", intPort);

However on the receiving side instead of getting a char of 128 or 143 I get
a char of 63.

Now the documentation does say ascii support is limited to 0 - 127

However I am writing code to talk to several proprietary devices and I need
ascii support for the entire ascii character set.

Any ideas on a workaround for this issue?

Thanks in advance,

Pete.
 
M

MuZZy

Peter said:
Hi,

I have a statement in my code that looks like the following ::

intPort = 8080;
chr1 = (char)(128);
chr2 = (char)(143);

str1 = chr1.ToString() + chr1.ToString();

MySocket.Send(str1, "172.16.100.103", intPort);

However on the receiving side instead of getting a char of 128 or 143 I get
a char of 63.

Now the documentation does say ascii support is limited to 0 - 127

However I am writing code to talk to several proprietary devices and I need
ascii support for the entire ascii character set.

Any ideas on a workaround for this issue?

Thanks in advance,

Pete.


You can send it as a byte array instead of a char array...
 

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

Similar Threads


Top