The same problem.
 However if I send message from web interface in development mode (/
_ah/admin/xmpp), it works fine.

 I've tried to log char codes. It returns 65533 for System.out.println
((int)msg.getBody().getCodePointAt(0)) for all Cyrillic letters.

On Sep 9, 1:45 pm, Artem Kuroptev <kurop...@gmail.com> wrote:
> There sure is, if xmpp reffers XMPPService instnce :-) The source code
> follows.
> I have made screenshot with Google Talk 
> also:http://farm4.static.flickr.com/3533/3902870863_a935be9197.jpg
>
> ---------------------------------------------
> public class ChatBotServlet extends HttpServlet
> {
>     private static final Logger log = Logger.getLogger
> (ChatBotServlet.class.getName());
>
>     private static final String JABBER_ID = "gaechat...@appspot.com";
>     private JID myJID = null;
>
>     public void init() throws ServletException
>     {
>         myJID = new JID(JABBER_ID);
>     }
>
>     protected void doPost(HttpServletRequest request,
> HttpServletResponse response) throws ServletException, IOException
>     {
>         //request.setCharacterEncoding("utf-8");
>         XMPPService xmpp = XMPPServiceFactory.getXMPPService();
>         Message msg = xmpp.parseMessage(request);
>
>         JID fromJid = msg.getFromJid();
>         String body = msg.getBody();
>
>         final String msgBody = "From: "+fromJid+", Text: "+body;
>         log.info("xmpp received: " + msgBody);
>         final Message outmsg = new MessageBuilder()
>                 .withRecipientJids(fromJid)
>                 .withBody(msgBody)
>                 .build();
>
>         boolean messageSent = false;
>
>         if (xmpp.getPresence(fromJid).isAvailable())
>         {
>             SendResponse status = xmpp.sendMessage(outmsg);
>             messageSent = (status.getStatusMap().get(fromJid) ==
> SendResponse.Status.SUCCESS);
>
>         }
>
>         if (!messageSent)
>         {
>             log.warning("outgoing message hasn't been sent to: " +
> fromJid);
>         }
>
>     }
>
>     protected void doGet(HttpServletRequest request,
> HttpServletResponse response) throws ServletException, IOException
>     {
>         //throw new ServletException("doGet is not supported");
>     }}
>
> ---------------------------------------------
>
> On Sep 9, 2:37 pm, "Nick Johnson (Google)" <nick.john...@google.com>
> wrote:
>
>
>
> > Hi Artem,
> > There is no 'xmpp.parseMessage' method. What method/class are you referring
> > to? Can you please paste the code you're using, and the exception (if any)
> > you're getting?
>
> > -Nick Johnson
>
> > On Tue, Sep 8, 2009 at 3:23 PM, Artem Kuroptev <kurop...@gmail.com> wrote:
>
> > > I have created a simple echo xmpp chat bot at gaechat...@appspot.com.
> > > It works fine for latin characters and I get blank squareы for non-
> > > latin. Ihave tried to use
> > > request.setCharacterEncoding("utf-8");
> > > as a first call at doPost, but that doesn't work.
> > > I guess XMPPService.parseMessage method do not takes into account the
> > > encoding of POST request. Probably it is possible to parse post
> > > request by myself (without XMPPService) and to brute force the
> > > character encoding used by requester in Google backed. But if there is
> > > a better way?
>
> > --
> > Nick Johnson, Developer Programs Engineer, App Engine

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to