]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
fix legacy encodings
authorAilin Nemui <redacted>
Sat, 3 Feb 2018 19:34:24 +0000 (20:34 +0100)
committerAilin Nemui <redacted>
Sat, 3 Feb 2018 19:34:24 +0000 (20:34 +0100)
scripts/trackbar.pl

index 95d6a353111012ce94debedd7ebbd06c427d8bcd..2537db060f8751b16db760811daa3c007a5933c2 100644 (file)
@@ -362,9 +362,7 @@ sub screen_length;
   else {
       *screen_length = sub {
           my $temp = shift;
-          if (is_utf8()) {
-              Encode::_utf8_on($temp);
-          }
+          Encode::_utf8_on($temp) if is_utf8();
           length($temp)
       };
   }
@@ -388,7 +386,7 @@ sub line {
     $string = ' ' unless length $string;
     $time ||= time;
 
-    Encode::_utf8_on($string);
+    Encode::_utf8_on($string) if is_utf8();
     my $length = c_length($string);
 
     my $format = '';
@@ -402,7 +400,9 @@ sub line {
 
     my $times = $width / $length;
     $times += 1 if $times != int $times;
-    $format .= $config{style};
+    my $style = "$config{style}";
+    Encode::_utf8_on($style) if is_utf8();
+    $format .= $style;
     $width -= c_length($format);
     $string x= $times;
     chop $string while length $string && c_length($string) > $width;
git clone https://git.99rst.org/PROJECT