about summary refs log tree commit
diff options
context:
space:
mode:
authorGraham Barr <gbarr@pobox.com>2007-02-10 13:10:15 +0000
committerGraham Barr <gbarr@pobox.com>2009-02-24 10:40:47 -0600
commita6dad2861af99ff15840cd3fb276e941dcab07ff (patch)
tree154891f87a5d2f495971de6ce92038d736214fed
parent6ce1e6228c272aa83558dcbbe62d95c93d227f76 (diff)
downloadperl-libnet-a6dad2861af99ff15840cd3fb276e941dcab07ff.tar.gz
Fix bug causing utf8 encoding of 8bit strings
-rw-r--r--Net/Cmd.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/Net/Cmd.pm b/Net/Cmd.pm
index 201349f..feb9ae0 100644
--- a/Net/Cmd.pm
+++ b/Net/Cmd.pm
@@ -23,7 +23,7 @@ BEGIN {
 
 my $doUTF8 = eval { require utf8 };
 
-$VERSION = "2.27";
+$VERSION = "2.28";
 @ISA     = qw(Exporter);
 @EXPORT  = qw(CMD_INFO CMD_OK CMD_MORE CMD_REJECT CMD_ERROR CMD_PENDING);
 
@@ -395,7 +395,7 @@ sub datasend
  my $arr = @_ == 1 && ref($_[0]) ? $_[0] : \@_;
  my $line = join("" ,@$arr);
 
- utf8::encode($line) if $doUTF8;
+ utf8::encode($line) if $doUTF8 and utf8::is_utf8($line);
 
  return 0 unless defined(fileno($cmd));