* [sup-talk] Ruby 1.9: encodings
@ 2009-11-07 3:22 Andrei Thorp
2009-12-18 15:37 ` Gaute Hope
0 siblings, 1 reply; 5+ messages in thread
From: Andrei Thorp @ 2009-11-07 3:22 UTC (permalink / raw)
To: sup-talk
Eh, bad news.
So I've been testing Sup in an 1.9 environment further, and I have
found that there are a great deal of problems with regards to
encodings. "invalid byte sequence in US-ASCII" is something you'll see
frequently. This seems to be when parsing messages that have non-ascii
chararacters.
Ouch :(
Has this already been taken care of in the git somewhere?
-AT
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [sup-talk] Ruby 1.9: encodings
2009-11-07 3:22 [sup-talk] Ruby 1.9: encodings Andrei Thorp
@ 2009-12-18 15:37 ` Gaute Hope
2009-12-19 18:34 ` William Morgan
0 siblings, 1 reply; 5+ messages in thread
From: Gaute Hope @ 2009-12-18 15:37 UTC (permalink / raw)
To: Andrei Thorp; +Cc: sup-talk
I just tried.. im getting the same, afraid im not skilled enough to
figure out what is wrong thou..
--- ArgumentError from thread: load threads for thread-index-mode
invalid byte sequence in US-ASCII
/home/gaute/dev/ruby/sup.git/lib/sup/util.rb:181:in `scan'
/home/gaute/dev/ruby/sup.git/lib/sup/util.rb:181:in `display_length'
/home/gaute/dev/ruby/sup.git/lib/sup/modes/scroll-mode.rb:224:in
`block in draw_line_from_array'
/home/gaute/dev/ruby/sup.git/lib/sup/modes/scroll-mode.rb:222:in `each'
/home/gaute/dev/ruby/sup.git/lib/sup/modes/scroll-mode.rb:222:in
`each_with_index'
/home/gaute/dev/ruby/sup.git/lib/sup/modes/scroll-mode.rb:222:in
`draw_line_from_array'
/home/gaute/dev/ruby/sup.git/lib/sup/modes/scroll-mode.rb:197:in `draw_line'
/home/gaute/dev/ruby/sup.git/lib/sup/modes/line-cursor-mode.rb:50:in `draw_line'
/home/gaute/dev/ruby/sup.git/lib/sup/modes/scroll-mode.rb:48:in `block in draw'
/home/gaute/dev/ruby/sup.git/lib/sup/modes/scroll-mode.rb:48:in `each'
/home/gaute/dev/ruby/sup.git/lib/sup/modes/scroll-mode.rb:48:in `draw'
/home/gaute/dev/ruby/sup.git/lib/sup/modes/line-cursor-mode.rb:37:in `draw'
/home/gaute/dev/ruby/sup.git/lib/sup/buffer.rb:108:in `draw'
/home/gaute/dev/ruby/sup.git/lib/sup/buffer.rb:92:in `redraw'
/home/gaute/dev/ruby/sup.git/lib/sup/buffer.rb:329:in `draw_screen'
/home/gaute/dev/ruby/sup.git/lib/sup/buffer.rb:744:in `clear'
/home/gaute/dev/ruby/sup.git/lib/sup/util.rb:520:in `method_missing'
/home/gaute/dev/ruby/sup.git/lib/sup/modes/thread-index-mode.rb:638:in
`load_n_threads'
(eval):12:in `load_n_threads'
/home/gaute/dev/ruby/sup.git/lib/sup/modes/thread-index-mode.rb:609:in
`block in load_n_threads_background'
/home/gaute/dev/ruby/sup.git/lib/sup.rb:78:in `block in reporting_thread'
- gaute
On Sat, Nov 7, 2009 at 4:22 AM, Andrei Thorp <garoth@gmail.com> wrote:
> Eh, bad news.
>
> So I've been testing Sup in an 1.9 environment further, and I have
> found that there are a great deal of problems with regards to
> encodings. "invalid byte sequence in US-ASCII" is something you'll see
> frequently. This seems to be when parsing messages that have non-ascii
> chararacters.
>
> Ouch :(
>
> Has this already been taken care of in the git somewhere?
>
> -AT
> _______________________________________________
> sup-talk mailing list
> sup-talk@rubyforge.org
> http://rubyforge.org/mailman/listinfo/sup-talk
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [sup-talk] Ruby 1.9: encodings
2009-12-18 15:37 ` Gaute Hope
@ 2009-12-19 18:34 ` William Morgan
2009-12-24 16:43 ` Andrei Thorp
0 siblings, 1 reply; 5+ messages in thread
From: William Morgan @ 2009-12-19 18:34 UTC (permalink / raw)
To: sup-talk
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [sup-talk] Ruby 1.9: encodings
2009-12-19 18:34 ` William Morgan
@ 2009-12-24 16:43 ` Andrei Thorp
2009-12-24 16:47 ` Andrei Thorp
0 siblings, 1 reply; 5+ messages in thread
From: Andrei Thorp @ 2009-12-24 16:43 UTC (permalink / raw)
To: sup-talk, William Morgan
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [sup-talk] Ruby 1.9: encodings
2009-12-24 16:43 ` Andrei Thorp
@ 2009-12-24 16:47 ` Andrei Thorp
0 siblings, 0 replies; 5+ messages in thread
From: Andrei Thorp @ 2009-12-24 16:47 UTC (permalink / raw)
To: sup-talk, William Morgan
On Thu, Dec 24, 2009 at 11:43 AM, Andrei Thorp <garoth@gmail.com> wrote:
> 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
Err, sorry. And when I say "deleting that function" I mean manually
applying your patch carefully.
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-12-24 16:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-07 3:22 [sup-talk] Ruby 1.9: encodings Andrei Thorp
2009-12-18 15:37 ` Gaute Hope
2009-12-19 18:34 ` William Morgan
2009-12-24 16:43 ` Andrei Thorp
2009-12-24 16:47 ` Andrei Thorp
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox