[JDEV] Problem : Perl + Accented Characters

David Waite mass at akuma.org
Tue Aug 6 12:14:31 CDT 2002


Try encoding the text being outputted in UTF-8. When your windows client 
sends the above text, it is properly escaped.

-David Waite

Sylvinus Prodi wrote:

> Hi
>  
> I'm working since yesterday on a strange issue with perl and jabber :
>  
> Here's my test script, it sends a message "yep" to my windows client 
> without problems, as any message without accented characters
> I replace "yep" by "éééééé.", it works. I replace it by "ééééééé.", i 
> get a <stream:error>Invalid XML</stream:error> and disconnection
>  
> I think this issue is related with perl because when I send the same 
> msg from my windows client it obviously works....
>  
> Can anyone help me pleaseeeeeee ?
>  
> Thanks in advance
>  
> sylvinus
>  
>  
>  
>  
>  
> #!/usr/bin/perl
>
> use IO::Socket;
>  
> $jclient= IO::Socket::INET->new
> (
>     PeerAddr => "jabber.org",
>     PeerPort => 5222,
>     Proto    => "tcp",
>     Type     => SOCK_STREAM,
>     Timeout  => 10
> ) or die "Connection error\n";
>  
> $packet='<stream:stream to="158.64.60.160" xmlns="jabber:client" 
> xmlns:stream="http://etherx.jabber.org/streams">
> <iq type="set" id=sylvinus at 158.64.60.160/nothing 
> <mailto:id=sylvinus at 158.64.60.160/nothing>><query 
> xmlns="jabber:iq:auth"><username>sylvinus</username><password>********</password><resource>nothing</resource><
> /query></iq>
> <message from="sylvinus at jabber.org <mailto:sylvinus at jabber.org>" 
> to="sylvinus at 158.64.60.160/exodus 
> <mailto:sylvinus at 158.64.60.160/exodus>" 
> type="chat"><body>yep</body></message>
> ';
>
> print $jclient $packet;
> print "sending $packet\n";
>  





More information about the JDev mailing list