[Help] Client Server Question

T

Tiraman

hi,

i build some client server application which work with sockets
(System.Net.Sockets)

and when i m sending data (Hebrew text) from the server to the client and
backward i m getting the text not so well (gibberish or some thing not
readable)

any idea ?

Best Regards ,

Tiraman :)
 
T

Tiraman

hi,

i m using this kind of code to send the data

Dim oSWriter As New IO.StreamWriter(client.GetStream) ' the client is
TcpClient
oSWriter.Write(data & vbCr)
oSWriter.Flush()

and i m reading the data by doing this

sText = Encoding.ASCII.GetString(readBuffer, 0, BytesRead)

Thanks For your Help.


David Williams said:
How are you transfering the text? It sounds like the method that you are
using is not fully Unicode aware, or at least is not using the Unicode
encoding class.
 
I

Imran Koradia

you might want to try Encoding.Unicode.GetString(readBuffer, 0, BytesRead)
instead of the ASCII version..

imran.
 
T

Tiraman

Thanks i will try it.

Imran Koradia said:
you might want to try Encoding.Unicode.GetString(readBuffer, 0, BytesRead)
instead of the ASCII version..

imran.
 

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