You should try encoding the string php side and decoding in the client javascript with something like "decodeURIComponent". I'm not sure exactly which encoding function works best. I never had "BAD_JSON" problem but encoding problem yes. While not using inlinepush, "encodeURIComponent" and "decodeURIComponent" seems to work best for me.
- Louis Le 2012-05-25 à 19:29, pacrook a écrit : > Using the APE server inlinepush, if I try and push a string containing > an accented character I get BAD_JSON back from the server, for > example: > > http://ape.server:6969/?[{"cmd":"inlinepush","params":{"raw":"postmsg","data":{"dots":[{"name":"Café"}]},"password":"testpasswd","channel":"testchannel"}}] > > [{"time":"1337987563","raw":"ERR","data": > {"code":"005","value":"BAD_JSON"}}] > > change that to: > > http://ape.server:6969/??[{"cmd":"inlinepush","params":{"raw":"postmsg","data":{"dots":[{"name":"Cafe"}]},"password":"testpasswd","channel":"testchannel"}}] > > [{"time":"1337987858","raw":"pushed","data":{"value":"ok"}}] > > and all is okay. > > So the accented é in Café seems to be a problem even though it gets > encoded as Caf%C3%A9% by the browser before being pushed. > > I've seen the discussion is this group "Does APE supports UNICODE?" > from Dec 2011 but wasn't clear from the description if this it the > same issue. > > I downloaded and compiled the APE server from the GIT repository on > Fedeora 15 (Linux). > > -- > You received this message because you are subscribed to the Google > Groups "APE Project" 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/ape-project?hl=en > --- > APE Project (Ajax Push Engine) > Official website : http://www.ape-project.org/ > Git Hub : http://github.com/APE-Project/ -- You received this message because you are subscribed to the Google Groups "APE Project" 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/ape-project?hl=en --- APE Project (Ajax Push Engine) Official website : http://www.ape-project.org/ Git Hub : http://github.com/APE-Project/
