6

I'm using Net::Jabber::Bot module in my Perl script and it works properly but one problem is that when I want to send a message all new lines get removed! Two questions :

  1. How we can have new lines in our messages? Should we disable achomp somewhere?
  2. What happens with new lines in Jabber/XMPP?
4

1 回答 1

3

这是一个已知问题,有人已经为此提交了补丁:http ://code.google.com/p/perl-net-jabber-bot/issues/detail?id=24

您无法直接发送 \n 但如果该代码不包含不可打印的字符,您也许可以发送 xmpp/jabber 编码的换行符。

在这个子中:

sub _send_individual_message {
...
# Strip out anything that's not a printable character
# Now with unicode support?
$message_chunk =~ s/[^[:print:]]+/./xmsg; 
于 2012-12-07T09:20:41.090 回答