diff options
author | Christian Pointner <equinox@helsinki.at> | 2011-07-25 23:12:20 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2011-07-25 23:12:20 (GMT) |
commit | 1132662fbd2b737a61eef74c5e7fc0031b34c75a (patch) | |
tree | 963e8acab1f18b097de953248e447affde20231f /rhimport-dn | |
parent | c1436dfaf89f8c02f7c6d56e24d345232398a1f3 (diff) |
utf-8 support
git-svn-id: https://svn.helsinki.at/rhimport/trunk@96 7c65635b-ec39-4f67-a626-873dbafdd612
Diffstat (limited to 'rhimport-dn')
-rwxr-xr-x | rhimport-dn | 8 |
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"; |