comopasta Gr
2011-May-20 23:29 UTC
Rails DB defaults to utf8 for mysql -- but unicode for postgresql
Hi, Creating a new Rails application with -d postgresql sets the encoding in the database.yml to unicode Creating a new Rails with -d mysql sets the encoding to utf8 Any ideas why this difference? I''ve been having problems with encoding due to localization, accents, json and what no. I thought I was using utf8 and not unicode. Would this have any impact? If this would be an issue? What to take into account when doing a change of that type on a production DB? Thanks. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2011-May-21 07:35 UTC
Re: Rails DB defaults to utf8 for mysql -- but unicode for postgresql
On May 21, 12:29 am, comopasta Gr <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi, > > Creating a new Rails application with -d postgresql sets the encoding in > the database.yml to unicode > > Creating a new Rails with -d mysql sets the encoding to utf8 >According to http://www.postgresql.org/docs/8.4/static/multibyte.html Unicode as an encoding name is just an alias for UTF8. Earlier versions only list Unicode as the name of that encoding, so I assuming this means that setting the name unicode ensures that a range of postgresql versions will use UTF8 (or perhaps the database.yml template hasn''t been updated from the time where the only name for UTF8 was Unicode) Fred Fred> Any ideas why this difference? > > I''ve been having problems with encoding due to localization, accents, > json and what no. I thought I was using utf8 and not unicode. Would this > have any impact? > > If this would be an issue? What to take into account when doing a change > of that type on a production DB? > > Thanks. > > -- > Posted viahttp://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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
comopasta Gr
2011-May-21 08:20 UTC
Re: Rails DB defaults to utf8 for mysql -- but unicode for postgresql
> According to http://www.postgresql.org/docs/8.4/static/multibyte.html > Unicode as an encoding name is just an alias for UTF8. Earlier > versions only list Unicode as the name of that encoding, so I assuming > this means that setting the name unicode ensures that a range of > postgresql versions will use UTF8 (or perhaps the database.yml > template hasn''t been updated from the time where the only name for > UTF8 was Unicode) > > Fred > > FredYeah I checked the same and saw that UTF8 was listed. But confused because different opinions regarding their meanings varies. And also that Rails would make that differentiation. But checking the db with PgAdmin3 locally I can see this info: CREATE DATABASE app_development WITH OWNER = me ENCODING = ''UTF8'' TABLESPACE = pg_default CONNECTION LIMIT = -1; So ultimately encoding: unicode translates into utf8 Thanks Fred! -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.