SHA256
1
0
forked from pool/perl
perl/perl-netcmdutf8.diff
OBS User autobuild f0367f4a88 Accepting request 23098 from devel:languages:perl
Copy from devel:languages:perl/perl based on submit request 23098 from user coolo

OBS-URL: https://build.opensuse.org/request/show/23098
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/perl?expand=0&rev=34
2009-10-26 16:04:51 +00:00

25 lines
650 B
Diff

--- ./lib/Net/Cmd.pm.orig 2009-09-03 14:32:13.000000000 +0000
+++ ./lib/Net/Cmd.pm 2009-09-03 14:47:30.000000000 +0000
@@ -226,6 +226,10 @@ sub command {
$str = $cmd->toascii($str) if $tr;
$str .= "\015\012";
+ # encode to individual utf8 bytes if
+ # $str is a string (in internal UTF-8)
+ utf8::encode($str) if is_utf8($str);
+
my $len = length $str;
my $swlen;
@@ -473,6 +477,10 @@ sub rawdatasend {
return 0 unless defined(fileno($cmd));
+ # encode to individual utf8 bytes if
+ # $line is a string (in internal UTF-8)
+ utf8::encode($line) if is_utf8($line);
+
return 1
unless length($line);