I am working on an XMPP client and having an issue with messages being sent/received by Strophe (javascript version).
The issue is messages that contain "special" characters. For instance, if I send:
I'm here.
An external client (i.e. iChat) will display
I'm here.
A strophe client doesn't display anything at all.
If I send that same message from iChat to the strophe client, it displays properly.
Here is the most basic sample code I could come up with:
<html>
<head>
<script type='text/javascript' src='strophe.min.js'></script>
<script type='text/javascript'>
function onConnect(status) {
if (status == Strophe.Status.CONNECTED) {
var message = $msg({to: CONTACT_JID, from: JID, type: 'chat'}).c('body').t("I'm here."); ;
connection.send(message.tree());
}
}
var connection = new Strophe.Connection('http://bosh.metajack.im:5280/xmpp-httpbind');
connection.connect(JID, PASS, onConnect);
</script>
</head>
<body></body>
</html>
Thanks in advance for any help.
Edit:
Outbound, it seems Strophe is double encoding. When I type
I'm
it is sending
<body>I&apos;m</body>
Inbound, it appears to not be handling CDATA properly. Any guidance or ideas are appreciated.