Hello
We are using the Serial Tutorial example that uses AsyncStreams to received data via Bluetooth.
It is working fine but the data I’m receiving contains special ASCII characters which are not being received properly by my application – they are being received as 2 bytes instead of one.
I have changed the encoding from UTF8 to ISO-8859-1 but it has not fixed the issue
Any help would be greatly appreciated.
Regards,
Lorna
We are using the Serial Tutorial example that uses AsyncStreams to received data via Bluetooth.
It is working fine but the data I’m receiving contains special ASCII characters which are not being received properly by my application – they are being received as 2 bytes instead of one.
I have changed the encoding from UTF8 to ISO-8859-1 but it has not fixed the issue
B4X:
Dim SaveStr As String
Dim LorStr As String
----------------------
Sub AStream_NewData (Buffer() As Byte)
LorStr = BytesToString(Buffer, 0, Buffer.Length, "ISO-8859-1")
SaveStr = SaveStr & LorStr ' Concatenate string
Save_file(SaveStr) ' Save to txt file
End Sub
Any help would be greatly appreciated.
Regards,
Lorna