summaryrefslogtreecommitdiff
path: root/rhimport-dn
diff options
context:
space:
mode:
Diffstat (limited to 'rhimport-dn')
-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";