diff options
author | Renato Botelho <garga@FreeBSD.org> | 2009-12-14 15:44:07 +0000 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2009-12-14 15:44:07 +0000 |
commit | b93803c0b87d34485e64e8d692119e8e0a882b0e (patch) | |
tree | 72e8c2eda923a0cde82246560bb3c55ee45e348a /net-im | |
parent | 3b5484cfe75dfeb199bfde0d51d82dcadc6ce2bd (diff) | |
download | ports-b93803c0b87d34485e64e8d692119e8e0a882b0e.tar.gz ports-b93803c0b87d34485e64e8d692119e8e0a882b0e.zip |
Notes
Diffstat (limited to 'net-im')
-rw-r--r-- | net-im/twirssi/files/patch-twirssi.pl | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/net-im/twirssi/files/patch-twirssi.pl b/net-im/twirssi/files/patch-twirssi.pl new file mode 100644 index 000000000000..583fc158c7a3 --- /dev/null +++ b/net-im/twirssi/files/patch-twirssi.pl @@ -0,0 +1,60 @@ +--- twirssi.pl 2009-11-09 08:40:49.000000000 -0200 ++++ twirssi.pl 2009-11-06 18:03:05.000000000 -0200 +@@ -851,7 +851,7 @@ + return unless &logged_in($twit); + + my ( $fh, $filename ) = File::Temp::tempfile(); +- binmode( $fh, ":utf8" ); ++ binmode( $fh, ":" . &get_charset ); + $child_pid = fork(); + + if ($child_pid) { # parent +@@ -1213,7 +1213,7 @@ + # pretend + + if ( open FILE, $filename ) { +- binmode FILE, ":utf8"; ++ binmode FILE, ":" . &get_charset; + my @lines; + my %new_cache; + while (<FILE>) { +@@ -1596,6 +1596,13 @@ + return 60; + } + ++sub get_charset { ++ my $charset = Irssi::settings_get_str("twirssi_charset"); ++ print scalar localtime, " - charset: '$charset'" if &debug; ++ return "utf8" if $charset =~ /^\s*$/; ++ return $charset; ++} ++ + sub hilight { + my $text = shift; + +@@ -1636,7 +1643,7 @@ + "Set short_url_args to username,API_key or change your", + "short_url_provider." + ); +- return decode "utf8", $data; ++ return decode &get_charset, $data; + } + } + +@@ -1653,7 +1660,7 @@ + } + } + +- return decode "utf8", $data; ++ return decode &get_charset, $data; + } + + sub normalize_username { +@@ -1695,6 +1702,7 @@ + ); + + Irssi::settings_add_int( "twirssi", "twitter_poll_interval", 300 ); ++Irssi::settings_add_str( "twirssi", "twirssi_charset", "utf8" ); + Irssi::settings_add_str( "twirssi", "twitter_window", "twitter" ); + Irssi::settings_add_str( "twirssi", "bitlbee_server", "bitlbee" ); + Irssi::settings_add_str( "twirssi", "short_url_provider", "TinyURL" ); |