Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] [PATCH] Add UTF-8 encoding string for ArchLinux systems
@ 2009-08-25  9:29 Israel Herraiz
  2009-09-01  2:57 ` William Morgan
  0 siblings, 1 reply; 2+ messages in thread
From: Israel Herraiz @ 2009-08-25  9:29 UTC (permalink / raw)


Hi,

in ArchLinux, UTF-8 encoding is identified by "utf8" instead of
"UTF-8".

Cheers,
Israel

---
 lib/sup/util.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/sup/util.rb b/lib/sup/util.rb
index 068ce6b..f99e1c1 100644
--- a/lib/sup/util.rb
+++ b/lib/sup/util.rb
@@ -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
-- 
1.6.4




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-01  2:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-25  9:29 [sup-talk] [PATCH] Add UTF-8 encoding string for ArchLinux systems Israel Herraiz
2009-09-01  2:57 ` William Morgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox