Re: Re: UTF-8 String.strip bug

Colin Law
2010-12-15T08:50:43Z

On 15 December 2010 00:02, Bob Mundane
<lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>
wrote:
> I don''t see the ''é'' in your snippet code. Did
you tried with real
> accentuated chars ?

Is this in reply to my response?  You have not quoted anything and
have changed the subject line so gmail has not linked up the thread.

If so I don''t understand when you say you do not see the accented
char, copying from my previous post:
$ rails console
Loading development environment (Rails 3.0.3)
ruby-1.9.2-p0 > "Café Noir ".strip
 => "Café Noir"
ruby-1.9.2-p0 > "Café ".strip
 => "Café"
I see accented char é.

It is interesting, though, that the é in your mail looks different to
the one here, even though I have just copied and pasted it from your
email into mine.  It does look like yours though when I paste it into
the ruby console.  What happens if you copy it from here and use it in
your console?

>
> I''m using Ruby enterprise edition 1.8.x - I didn''t
thought about a
> possible bug in Ruby itself. I might try a more recent 1.8 version or
> REE... Don''t want to switch to 1.9 just for a so small (but
annoying)
> problem...

This is the result in 1.8.7
$ ruby script/console
Loading development environment (Rails 2.3.2)
ruby-1.8.7-p302 >  "Café Noir ".strip
 => "Café Noir"
ruby-1.8.7-p302 > "Café ".strip
 => "Café"
ruby-1.8.7-p302 >


Of course maybe your response was not to my mail at all, in which case
I have been wasting my time.

Colin