[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sup-talk] Ruby 1.9: encodings



On Sat, Dec 19, 2009 at 1:34 PM, William Morgan
<wmorgan-sup@masanjin.net> wrote:
> 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
>

Nope, sorry. After deleting that function,

--- ArgumentError from thread: load threads for thread-index-mode
invalid byte sequence in US-ASCII
/usr/lib/ruby/gems/1.9.1/gems/sup-0.9.1/lib/sup/person.rb:10:in `gsub'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.9.1/lib/sup/person.rb:10:in `initialize'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.9.1/lib/sup/xapian_index.rb:84:in `new'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.9.1/lib/sup/xapian_index.rb:84:in
`block in build_message'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.9.1/lib/sup/xapian_index.rb:86:in `map!'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.9.1/lib/sup/xapian_index.rb:86:in
`build_message'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.9.1/lib/sup/xapian_index.rb:176:in
`block (2 levels) in each_message_in_thread_for'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.9.1/lib/sup/thread.rb:343:in `call'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.9.1/lib/sup/thread.rb:343:in
`block in load_thread_for_message'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.9.1/lib/sup/xapian_index.rb:176:in
`block in each_message_in_thread_for'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.9.1/lib/sup/xapian_index.rb:176:in `each'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.9.1/lib/sup/xapian_index.rb:176:in
`each_message_in_thread_for'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.9.1/lib/sup/thread.rb:341:in
`load_thread_for_message'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.9.1/lib/sup/thread.rb:333:in
`block in load_n_threads'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.9.1/lib/sup/xapian_index.rb:151:in
`block in each_id_by_date'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.9.1/lib/sup/xapian_index.rb:144:in
`block in each_id'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.9.1/lib/sup/xapian_index.rb:144:in `each'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.9.1/lib/sup/xapian_index.rb:144:in `each_id'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.9.1/lib/sup/xapian_index.rb:151:in
`each_id_by_date'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.9.1/lib/sup/thread.rb:328:in
`load_n_threads'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.9.1/lib/sup/modes/thread-index-mode.rb:625:in
`load_n_threads'
(eval):12:in `load_n_threads'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.9.1/lib/sup/modes/thread-index-mode.rb:609:in
`block in load_n_threads_background'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.9.1/lib/sup.rb:77:in `block in
reporting_thread'

Though perhaps it would be easier for you to try out 1.9 + sup + utf8
for yourself? I'm sure you already have some UTF8 in your messages, so
you'd just need the new ruby. I have a feeling there are a lot of
small bugs and it may be a hassle doing debugging by proxy (though I'm
willing).

-AT
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk