On Fri, May 22, 2009 at 11:42 AM, John-Paul Bader <[email protected]> wrote: > Hrm, > > meanwhile I've read through many forum threads (which are more confusing > than helpful) and I also played around with that issue a bit more. > > First of all I set up a clean install of Ruby1.9, Rails, Postgresql83 and > http://github.com/qoobaa/pg/tree/master as the postgres adapter which claims > to support ruby1.9 utf-8 (whatever that means). I even initialized the DB > with UTF-8 but the results seem to be the same like on sqlite3 and mysql. > > Whenever I enter something like this to the console: > > Post.create :title => "รค" > > I'm getting back: > >>> Post.first.title > => "\xC3\xA4" > > Now as I said, this is the same for sqlite3, postgresql and mysql in various > configurations. So the db is returning utf8 as expected but I still don't > understand where its getting interpreted as us-ascii. Is it the db adapter > like this one http://github.com/qoobaa/pg/tree/master or is it really an > ActiveRecord problem like it is suggested in many forum posts?
No Ruby database libraries fully support 1.9 string encodings yet. You have to explicitly set the encoding of the strings returned. jeremy --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
