summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2011-07-25 23:12:20 (GMT)
committerChristian Pointner <equinox@helsinki.at>2011-07-25 23:12:20 (GMT)
commit263b115f15d0a50f7423b5a3ea5b5847cafa6083 (patch)
tree963e8acab1f18b097de953248e447affde20231f
parent73134d075ffcbd32ad2fcec6c0d79f8ddcf20e3b (diff)
utf-8 support
-rwxr-xr-xrhimport-dn8
1 files changed, 7 insertions, 1 deletions
diff --git a/rhimport-dn b/rhimport-dn
index 28941d5..d77c724 100755
--- a/rhimport-dn
+++ b/rhimport-dn
@@ -44,6 +44,10 @@ my $STAT_FILE = $ENV{'HOME'} . "/rhimport-dn.stat";
my $RSS_URL = "http://www.democracynow.org/podcast.xml";
my @PV_SCRIPT = ('/usr/bin/ssh', 'root@intranet', 'addnote', '111');
+binmode(STDIN, ":utf8");
+binmode(STDOUT, ":utf8");
+binmode(STDERR, ":utf8");
+
my $user = `/usr/bin/id -un`;
$user =~ s/\n//;
my $group = "democracyn";
@@ -113,6 +117,9 @@ for my $entry ($feed->entries) {
$writer->autoflush(1);
local $SIG{CHLD} = 'DEFAULT';
my $pid = open3($writer, $reader, $error, @PV_SCRIPT);
+ binmode($reader, ":utf8");
+ binmode($writer, ":utf8");
+ binmode($error, ":utf8");
print $writer $sum_title . "\n" . $sum_text;
close $writer;
waitpid $pid, 0;
@@ -121,7 +128,6 @@ for my $entry ($feed->entries) {
print "STDERR:\n" . join('', <$error>) . "\n";
print "STDOUT:\n" . join('', <$reader>) . "\n";
} else {
- print "\nPV: note added successfully";
print join('', <$reader>) . "\n";
}
print "\n";