]> git.cworth.org Git - sup/blobdiff - lib/sup/util.rb
Merge branch 'master' into next
[sup] / 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