diff options
| -rw-r--r-- | _data/scripts.yaml | 2 | ||||
| -rw-r--r-- | scripts/urlinfo.pl | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/_data/scripts.yaml b/_data/scripts.yaml index c173eca..af41d4d 100644 --- a/_data/scripts.yaml +++ b/_data/scripts.yaml @@ -4228,4 +4228,4 @@ modified: "2014-08-10" license: "WTFPL" name: "urlinfo" - version: "1.1" + version: "1.2" diff --git a/scripts/urlinfo.pl b/scripts/urlinfo.pl index 8715ebb..0a86fe1 100644 --- a/scripts/urlinfo.pl +++ b/scripts/urlinfo.pl @@ -1,9 +1,10 @@ use 5.014; use utf8; +use Encode; use Irssi; use POSIX (); -our $VERSION = "1.1"; +our $VERSION = "1.2"; our %IRSSI = ( authors => 'David Leadbeater', contact => 'dgl@dgl.cx', @@ -242,10 +243,10 @@ sub msg { fork_wrapper(sub { # Child my($fh) = @_; - syswrite $fh, " " . get_info($site, $uri); + syswrite $fh, " " . encode_utf8(get_info($site, $uri)); }, sub { # Parent - my($in) = @_; + my $in = decode_utf8($_[0]); if ($in =~ s/^- //) { print "\x{3}4urlinfo error:\x{3} $in"; return; @@ -325,7 +326,7 @@ sub fork_wrapper { $child->($wfh); }; alarm 0; - syswrite $wfh, "- $@" if $@; + syswrite $wfh, encode_utf8("- $@") if $@; POSIX::_exit(1); } } |
