2017-05-10 30 views
11

我有使用解析休息推UTF8编码信息的问题,这里是我的身体解析休息 - 推编码消息

{"where":{"$and":[{"email":{"$in":["[email protected]","[email protected]"]}},{"deviceType":{"$in":["ios"]}}]},"data":{"alert":"TEST: Giảm 40% Khi Mua Sách Harry Potter","sound":"default","page_type":"cms_key","page_value":"harry-potter"}} 

有谁知道如何编码UTF8消息?

enter image description here

+0

是U相信什么你看到的不是一个字符集高清,美展现的screendump设备上的问题? parseServer和mongoDB支持都可以正确处理utf8,但是当后端提供的字节使用utf8时手机正在使用ISO? –

+0

我确定我的手机没有字符集问题。我经常从越南语言的其他应用程序收到通知。 –

+3

Thang,当您发送通知时,您将作为REST客户端使用什么?你确定在你的管道的那部分中没有'JSON'编码的问题吗? – SergGr

回答

2

Javascript代码:

public bool SendPushNotification(string jsonContent) 
{ 
... 

    request.Headers.Add("X-Parse-Application-Id", appId); 
    request.Headers.Add("X-Parse-REST-API-KEY", restApiKey); 

    System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding(); 
    Byte[] byteArray = encoding.GetBytes(jsonContent); 

... 
} 
+0

帮助你@ thang-pham? –