2013-02-11 137 views
0

我尝试使用语音字符发送消息,测试我使用一个简单的字符串:GCM Java服务器:发送消息和语音字符

 String message ="éèàôaaaa"; 

我GCM Java服务器源代码:

 // use this line to send message with payload data 
     Message message = new Message.Builder() 
      .collapseKey("1") 
      .timeToLive(3) 
      .delayWhileIdle(true) 
      .addData("Alerte : ", message) 
      .build(); 

在OSX上用eclipse: 一旦推送消息,在我的设备上(xperia s和nexus 7),我在状态栏中有“???? aaaa”

在带有eclipse的Windows7上: 一旦推送消息,在我的设备上(xperia s和nexus 7),我在状态栏中有“aaaa”

任何想法?

+0

奇怪的是,你有一个关键'Alerte:'(即带空格和冒号)。不过,我不知道这是不是你的问题。如果您尝试转储“Message”的内容(例如将Message.getData()的内容记录到文本文件中),您能看到正确的字符串吗? – Raffaele 2013-02-11 22:19:49

回答

0

这是因为你的unicode字符对URL不安全,请参阅我的其他answer。这同样适用于你的问题。

+0

没关系!我发现这个:http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2FwrkAdv_encoding.htm – Micka 2013-02-14 11:24:05

相关问题