AsyncStreams receive unicode (?)
I can read the response from AStreams_NewData
thats great, but there is no unicode...
instead of GREEK I got chinese... btw my server is ASP based
B4X:
Sub Process_Globals
Dim AStreams As AsyncStreams
Dim Socket1 As Socket
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
End Sub
Sub Socket1_Connected (Successful As Boolean)
If Successful = False Then
Msgbox(LastException.Message, "Error connecting")
Return
End If
AStreams.Initialize(Socket1.InputStream, Socket1.OutputStream, "AStreams")
Dim buffer() As Byte
Dim ff As String
ff="123456789012345678901234567890"
buffer = ff.GetBytes("UTF8")
AStreams.Write(buffer)
End Sub
Sub AStreams_NewData (Buffer() As Byte)
Dim msg As String
msg = BytesToString(Buffer, 0, Buffer.Length, "UTF8")
ToastMessageShow(msg, False)
End Sub
Sub Button1_Click
Socket1.Initialize("Socket1")
Socket1.Connect("10.0.0.136" , 50959, 20000)
End Sub
I can read the response from AStreams_NewData
thats great, but there is no unicode...
instead of GREEK I got chinese... btw my server is ASP based
Last edited: