Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: William Morgan <wmorgan-sup@masanjin.net>
To: sup-talk <sup-talk@rubyforge.org>
Subject: Re: [sup-talk] Ruby 1.9: encodings
Date: Sat, 19 Dec 2009 10:34:22 -0800	[thread overview]
Message-ID: <1261246544-sup-7566@masanjin.net> (raw)
In-Reply-To: <5a5b14cf0912180737n600fc2acx30fa14028d4a7662@mail.gmail.com>

Reformatted excerpts from Gaute Hope's message of 2009-12-18:
> I just tried.. im getting the same, afraid im not skilled enough to
> figure out what is wrong thou..

Do the errors still occur if you apply this patch?

diff --git a/lib/sup/util.rb b/lib/sup/util.rb
index f99e1c1..92aaff4 100644
--- a/lib/sup/util.rb
+++ b/lib/sup/util.rb
@@ -176,13 +176,7 @@ end
 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" || $encoding == "utf8"
-      scan(/./u).size
-    else
-      size
-    end
-  end
+  def display_length; length end
 
   def camel_to_hyphy
     self.gsub(/([a-z])([A-Z0-9])/, '\1-\2').downcase

-- 
William <wmorgan-sup@masanjin.net>
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


  reply	other threads:[~2009-12-19 18:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-07  3:22 Andrei Thorp
2009-12-18 15:37 ` Gaute Hope
2009-12-19 18:34   ` William Morgan [this message]
2009-12-24 16:43     ` Andrei Thorp
2009-12-24 16:47       ` Andrei Thorp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1261246544-sup-7566@masanjin.net \
    --to=wmorgan-sup@masanjin.net \
    --cc=sup-talk@rubyforge.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox