Hi All,
I am trying to send string from Android to PC VB.net. The connection is done with sockets and works very well. But all accentuated characters are replaced by "?"
example : if I want to send été (summer) I get ?t?
After having read all the forum regarding "encoding" or "getbyte" I have tried UTF-8, WINDOWS-1252 and ISO-8859-1
but no success
here is the PC side
Any idea please
I am trying to send string from Android to PC VB.net. The connection is done with sockets and works very well. But all accentuated characters are replaced by "?"
example : if I want to send été (summer) I get ?t?
After having read all the forum regarding "encoding" or "getbyte" I have tried UTF-8, WINDOWS-1252 and ISO-8859-1
but no success
B4X:
Sub SendMsg2Server
If Msg2Server.Length > 0 Then
Dim buffer() As Byte
buffer = Msg2Server.GetBytes("WINDOWS-1252") '("ISO-8859-1") '("UTF8")
Tcp.AStreams.Write(buffer)
Msg2Server = ""
End If
End Sub
here is the PC side
B4X:
Private Sub OnRecieve(ByVal ar As IAsyncResult) 'when something is received from server
Dim client As Socket = ar.AsyncState
client.EndReceive(ar)
Dim bytesRec As Byte() = byteData
Dim message As String = System.Text.ASCIIEncoding.ASCII.GetString(bytesRec) 'here is the message from server
Process(message, True)
End Sub
Any idea please