Ruby on Rails Sunday, July 31, 2011

Yes, that seems to work, but takes some time.
Thanks!

On 30 Juli, 23:58, Frederick Cheung <frederick.che...@gmail.com>
wrote:
> On Jul 30, 9:50 pm, jeb <jo...@ibiz.se> wrote:
>
> > No encoding set in database.yml, cp1252 set in mysql. By it self I
> > guess.
>
> that sounds like you should change the encoding for your existing
> tables/columns to utf8
>
> One way of doing this is to alter the columns to blobs and then back
> to a text column with the correct encoding (as documented at the
> bottom ofhttp://dev.mysql.com/doc/refman/5.0/en/alter-table.html)
>
> Fred
>
>
>
>
>
>
>
> > On 30 Juli, 22:37, Frederick Cheung <frederick.che...@gmail.com>
> > wrote:
>
> > > On Jul 30, 9:21 pm, jeb <jo...@ibiz.se> wrote:
>
> > > > That seems to work, the problem is when reading the data using mysql2.
> > > > In the database å is stored as å.
> > > > When I write to the database using mysql2, without having changed it,
> > > > it writes å.
>
> > > What does mysql think the column types are ? Before using mysql2, what
> > > encoding was set in your database.yml ?
>
> > > Fred
>
> > > > On 30 Juli, 22:17, Frederick Cheung <frederick.che...@gmail.com>
> > > > wrote:
>
> > > > > On Jul 30, 8:31 pm, jeb <jo...@ibiz.se> wrote:
>
> > > > > > I think it's more a question of how the data is stored in the
> > > > > > database.
> > > > > > In my layout i have:
> > > > > > <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
> > > > > > and in application.rb:
> > > > > > config.encoding = "utf-8"
>
> > > > > Also possible. If previously the database connection was configured as
> > > > > some latin1 variant and your columns were also latin1 but you were
> > > > > stuffing utf8 data into them then switching to mysql2 would cause data
> > > > > to appear messed up.
>
> > > > > Fred
>
> > > > > > :-) j
>
> > > > > > On 30 Juli, 20:15, Frederick Cheung <frederick.che...@gmail.com>
> > > > > > wrote:
>
> > > > > > > On Jul 30, 7:00 pm, jeb <jo...@ibiz.se> wrote:
>
> > > > > > > > When using the mysql2 gem with my excising databases all non-standard
> > > > > > > > chars gets messed up:
>
> > > > > > > > från is shown as från in the browser
>
> > > > > > > > Is this possible to fix or do I have to continue using the old mysql-
> > > > > > > > gem?
>
> > > > > > > IIRC mysql2 forces use of utf8. If you're elsewhere telling the
> > > > > > > browser that you're using a different character set then you'd get
> > > > > > > unwanted results.
>
> > > > > > > Fred

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment