Hello,

After hours trying to understand why I could not get the special
characters like é or à received from another user, I finally
understood the problem. I am now posting to;
1) get an explanation
2) let others know so they don't look for the same thing for hours
like me.

First of all, I probably am not using the chat in the usual way. I
don't think this should be a problem in itself, only that probably
this is why other users do not have to deal with it (just a guess).

So I do not use a channel at all, I just send a message to the server
who sends it back to the other user.

I send the message like this:
this.core.request.send('MSG', {'msg':msg,...

And when receiving it, I was using:
unescape (msg).

But it failed.
So I tried to escape it in the first place. That did not solve the
problem.

Eventually I came up with the right "formulae":

We have to use:
decodeURIcomponents(msg)
to get the proper result.

So why is that? I can still see in my code (which was based on a file
provided by APE itself) in French: "Les messages reçus du serveur sont
échappés" which means "messages received from the server are escaped".

My understanding is that this is a mistake. They should not be
unescaped, but we must use decodeURIcomponents.

Correct me if I am wrong. And please explain me why I need to do that,
when the demo example (using channels I believe) do not need it. (the
first demo actually uses unescape!!! and still é and à work fine).

Thx in advance.
And I hope this helps someone in the future. I really struggled for
that one.




-- 
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/

Reply via email to