We have build a chat app (B4A) which connects to a Chat server (B4J), backend Database is SQL server. Is there a special method required when sending the data to the server. Currently I get ?? on the receiver client instead of the emoji.
Sub encode_message(pData As String) As String
Dim su As StringUtils
Dim bytes() As Byte
Try
bytes = pData.GetBytes("UTF32")
Return su.EncodeBase64(bytes)
Catch
Return pData
End Try
End Sub
Sub decode_message(pData As String) As String
Dim su As StringUtils
Dim bc As ByteConverter
Dim bytes() As Byte
Try
bytes = su.DecodeBase64(pData)
Return bc.StringFromBytes(bytes,"UTF32")
Catch
Return pData
End Try
End Sub