Re: UTF-8 String.strip bug (and several over methods)

Colin Law
2010-12-14T16:46:58Z

On 14 December 2010 16:22, Bob Mundane
<lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>
wrote:
> Hello, with Rails 3.0.3
>
> "Café Noir ".strip => "Café noir"
> but
> "Café ".strip => "Caf\303\251"
>
> In fact, strip() doesn''t works if the last printable character is
> accentuated.

Strange, I get:
$ 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é"

Which Ruby are you using?

Colin