Forum: Ruby on Rails Bug in encoding: utf8 ?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Joram (Guest)
on 2007-02-27 22:49
(Received via mailing list)
Hello,

Today, I had to show some of the work done to my supervisor.
When I wanted to show that all the tests ran correctly iI just 'raked'
as usual. However, every single unit test had an error. Off course
that only happens when you have to do a demonstration.

The problem however, was quickly discovered.
I added yesterday 'encoding: utf8' to database.yml (MySql 5.0.22) to
correctly show some non-ascii characters, which works perfectly. After
removing this rule, all tests ran correctly.

The application itself had no problems with the new rule.
Is this a known bug? If so, is there a fix.
I'm running Rails 1.2.
Richard C. (Guest)
on 2007-03-05 18:06
(Received via mailing list)
On 2/27/07, Joram <removed_email_address@domain.invalid> wrote:
>
>
> The problem however, was quickly discovered.
> I added yesterday 'encoding: utf8' to database.yml (MySql 5.0.22) to
> correctly show some non-ascii characters, which works perfectly. After
> removing this rule, all tests ran correctly.
>
> The application itself had no problems with the new rule.
> Is this a known bug? If so, is there a fix.
> I'm running Rails 1.2.

Are all of your test scripts using UTF-8 string literals?

Rails 1.2 has a Chars class for UTF-8 text. Unlike kCODE which
modifies the Ruby string class methods to process UTF characters
correctly.
This topic is locked and can not be replied to.