]> git.cworth.org Git - sup/commitdiff
add UTF-8 encoding string for ArchLinux systems
authorIsrael Herraiz <israel.herraiz@gmail.com>
Tue, 25 Aug 2009 09:29:01 +0000 (11:29 +0200)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Tue, 1 Sep 2009 02:54:36 +0000 (22:54 -0400)
in ArchLinux, UTF-8 encoding is identified by "utf8" instead of
"UTF-8".

lib/sup/util.rb

index 068ce6bad904c9012bdcd5d8883ac48a68e59976..f99e1c17c79a3add8d5da43901c6b161d5c7170d 100644 (file)
@@ -177,7 +177,7 @@ class String
   ## nasty multibyte hack for ruby 1.8. if it's utf-8, split into chars using
   ## the utf8 regex and count those. otherwise, use the byte length.
   def display_length
-    if $encoding == "UTF-8"
+    if $encoding == "UTF-8" || $encoding == "utf8"
       scan(/./u).size
     else
       size