[Help] Client Server Question

  • Thread starter Thread starter Tiraman
  • Start date Start date
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 :-)
 
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.
 
you might want to try Encoding.Unicode.GetString(readBuffer, 0, BytesRead)
instead of the ASCII version..

imran.
 
Back
Top