I have just tried xmpp service.
I followed the example, i tried to send Chinese to Google Talk client,
but the 'body' part garbled.
me: 你好
terryapps: 你刚才发送给我的是(You just sent):������
I expected to see:
你刚才发送给我的是(You just sent):你好
Here is my code, did i miss something or is it a bug? Thanks!
@Override
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws IOException {
XMPPService xmpp = XMPPServiceFactory.getXMPPService();
Message message = xmpp.parseMessage(req);
JID jid = message.getFromJid();
String body = message.getBody();
String msgBody = "你刚才发送给我的是(You just sent):" + body;
Message msg = new
MessageBuilder().withRecipientJids(jid).withBody(
msgBody).build();
@SuppressWarnings("unused")
boolean messageSent = false;
if (xmpp.getPresence(jid).isAvailable()) {
SendResponse status = xmpp.sendMessage(msg);
messageSent = (status.getStatusMap().get(jid) ==
SendResponse.Status.SUCCESS);
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en
-~----------~----~----~----~------~----~------~--~---