Click here to Skip to main content
16,022,309 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i send text "üûùúýýþ" using network stream??

after i send it via networkstream, it become "???????" im using ASCII encoding. i try to change to Unicode encoding, and its not working.

This is my Code, its work fine with normal character like alphabets, numbes and symbols :
VB
Public Sub SendRequest(ByVal str As String, ByVal cl As clsTcpClient)
    Try
        Dim strm As NetworkStream = cl.GetStream

        strm.Write(Encoding.ASCII.GetBytes(str), 0, str.Length)
        gvar_status = "Idle"
    Catch ex As Exception
        gvar_status = "Failed"
    End Try
End Sub


Thanks.
Posted

1 solution

You probably need to encode as UTF8 or Unicode. Encoding.ASCII converts your characters to 7-bit ASCII so all of your characters will be lost in the conversion since they are all represented by 8-bit values.
 
Share this answer
 
Comments
Dwi Prawira 23-Aug-10 5:40am    
Its work great.. :)

Thanks..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900