Hello...
I'm getting a problem when using jsonparser fuction as follows:
- Device A sends data using a POST command to a server, and then the server delivers to device B
- Suppose that data is an emoji like this: ☺
- The data is correctly received by the server and stored in mysql database (correctly).
- When requested by B, the data is codified using json_decode due the presence of other fields for data control, generating something like this:
{"MESSAGERECEIVED":{"ID":"CC8667C65B900ED106FC8201807FCB07F07C9AF8470B1FA2F48333320D9CC720","IDCHAT":"BB2071692B892610D3222E9044384C27A05FD7FC1EEA30A738B39E2632339EB6","MSGDATA":"\u263a","MSGCREATED":1526588421517,"IDSOURCE":"638"}}
- Notice that the field "MSGDATA" is the original emoji correctly codified by json_encode at server side...
To receive data from server, a POST answer in the side B, using jsonparser, runs the routine:
...
- Showing MsgData content in a label.text in B side I got u263a (emoji text code!!!) instead of the emoji pic!
Then, I'm a little confused here. Shouldn't jsonparser had converted the \u263a to ☺ ? What am I doing wrong ?
I'm getting a problem when using jsonparser fuction as follows:
- Device A sends data using a POST command to a server, and then the server delivers to device B
- Suppose that data is an emoji like this: ☺
- The data is correctly received by the server and stored in mysql database (correctly).
- When requested by B, the data is codified using json_decode due the presence of other fields for data control, generating something like this:
{"MESSAGERECEIVED":{"ID":"CC8667C65B900ED106FC8201807FCB07F07C9AF8470B1FA2F48333320D9CC720","IDCHAT":"BB2071692B892610D3222E9044384C27A05FD7FC1EEA30A738B39E2632339EB6","MSGDATA":"\u263a","MSGCREATED":1526588421517,"IDSOURCE":"638"}}
- Notice that the field "MSGDATA" is the original emoji correctly codified by json_encode at server side...
To receive data from server, a POST answer in the side B, using jsonparser, runs the routine:
B4X:
Dim Resposta As Map
Resposta.Initialize
Resposta = Json1.NextObject
Dim NewMessage As Map
NewMessage.Initialize
NewMessage = Resposta.Get("MESSAGERECEIVED")
Dim IdMessage As String = NewMessage.Get("ID")
Dim IdChat As String = NewMessage.Get("IDCHAT")
Dim MsgData As String = NewMessage.Get("MSGDATA")
Dim MsgCreated As Long = NewMessage.Get("MSGCREATED")
Dim IdSource As Int = NewMessage.Get("IDSOURCE")
- Showing MsgData content in a label.text in B side I got u263a (emoji text code!!!) instead of the emoji pic!
Then, I'm a little confused here. Shouldn't jsonparser had converted the \u263a to ☺ ? What am I doing wrong ?