Skip Menu |
 

This queue is for tickets about the Net-Stomp CPAN distribution.

Report information
The Basics
Id: 52896
Status: resolved
Priority: 0/
Queue: Net-Stomp

People
Owner: Nobody in particular
Requestors: tongxiaojun [...] baofeng.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.30



Subject: Wide character in print.ERROR at Net/Stomp.pm 21 line!
Download (untitled) / with headers
text/plain 2.1k
Send Chinese Code will waring this: success send keyword Heartbreaker! Wide character in print at D:/Perl/lib/IO/Handle.pm line 406, <KFILE> line 4. success send keyword 御用闲人! Wide character in print at D:/Perl/lib/IO/Handle.pm line 406, <KFILE> line 5. success send keyword 夜隹大队! Wide character in print at D:/Perl/lib/IO/Handle.pm line 406, <KFILE> line 6. success send keyword 午夜郎君! Wide character in print at D:/Perl/lib/IO/Handle.pm line 406, <KFILE> line 7. success send keyword 美国派! Wide character in print at D:/Perl/lib/IO/Handle.pm line 406, <KFILE> line 8. Fixed: Edit Net/Stomp.pm package Net::Stomp; use strict; use warnings; use IO::Socket::INET; use IO::Select; use Net::Stomp::Frame; use base 'Class::Accessor::Fast'; __PACKAGE__->mk_accessors(qw(hostname port select socket)); our $VERSION = '0.34'; sub new { my $class = shift; my $self = $class->SUPER::new(@_); my $socket = IO::Socket::INET->new( PeerAddr => $self->hostname, PeerPort => $self->port, Proto => 'tcp' ); die "Error connecting to " . $self->hostname . ':' . $self->port . ": $!" unless $socket; binmode($socket); à binmode($socket, ':encoding(utf8)'); $self->socket($socket); my $select = IO::Select->new(); $select->add($socket); $self->select($select); return $self; } Code: #!/usr/bin/perl -w use strict; use warnings; use Net::Stomp::Receipt; use Encode; binmode(STDIN, ':encoding(utf8)'); binmode(STDERR, ':encoding(utf8)'); binmode(STDOUT, ':encoding(gbk)'); my $stomp = Net::Stomp::Receipt->new({hostname => '192.168.0.46',port => '61613',PERSISTENT => 1,}); print $stomp."\n"; $stomp->connect({login=> 'sa',passcode => '223238'}); my $mq = "keywordspider.keyword.queue"; open(KFILE,"keyword"); while(<KFILE>){ chomp(); my $keyword = decode("utf8",$_); $stomp->send_safe({destination => '/queue/editspider.keyword.queue',body => '{"keyword":"'.$keyword.'","isAlbum":"true","isVideo":"false","extension":""}'}) or die "Couldn't send the message!"; print "success send keyword $keyword!\n"; }
Closing since this bug has a 'Fixed In' attribute already.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.