Jeremy Kemper wrote:
> On Sat, Mar 21, 2009 at 7:52 AM, ruby.freeman <ruby.free...@gmail.com> 
> wrote:
>>
>> when I run console with ruby 1.9.1 and rails 2.3.2, and trying to do
>> something like
>>
>> User.first.name.encoding
>>
>> I'm getting #<Encoding:ASCII-8BIT>, though I've set "encoding: utf8"
>> in database.yml
>>
>> any suggestions?
> 
> The mysql driver is not encoding-aware yet.
> 
> jeremy

Same problem here with mysql and sqlite3.

When will the mysql and sqlite3 drivers be encoding-aware?

Is there a workaround?

I have problems with this because I'm from germany and need utf8 for the 
german umlauts.

If i save the templates as ANSI, the outputs from database with umlauts 
are working, but when i use umlauts directly in the templates i get this 
error:

invalid byte sequence for encoding "ASCII-8BIT"

If i save the templates as UTF8, the umlauts in the templates are 
working, but the outputs from the database with umlauts cause this 
error:

invalid byte sequence for encoding "UTF-8"


I'm using Ruby 1.9.1, Rails 2.3.2, mysql/ruby 2.8.1, sqlite3/ruby 1.2.4

slang17
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to