Forum: Ruby on Rails Should I be using UTF-8 mysql tables/database?

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.
Will (Guest)
on 2008-12-08 06:18
(Received via mailing list)
Hi,

Should I be using mysql tables/daatbase encoded in UTF-8 instead of
the default latin1?  What are the benefits of one vs. the other?

There is the possibility of needing to support other languages in the
future. We currently are running the latest ruby 1.8 and rails 2.1
(will probably upgrade to 2.2 in the near future).

Many thanks,

Will
Robert W. (Guest)
on 2008-12-08 16:51
> Should I be using mysql tables/daatbase encoded in UTF-8 instead of
> the default latin1?  What are the benefits of one vs. the other?
>
> There is the possibility of needing to support other languages in the
> future. We currently are running the latest ruby 1.8 and rails 2.1
> (will probably upgrade to 2.2 in the near future).
I think you just answered your own question. The reason to use UTF-8
would be to support other languages, especially languages that are not
based on latin.
Phlip (Guest)
on 2008-12-08 17:00
(Received via mailing list)
Robert W. wrote:

>> Should I be using mysql tables/daatbase encoded in UTF-8 instead of
>> the default latin1?  What are the benefits of one vs. the other?
>>
>> There is the possibility of needing to support other languages in the
>> future. We currently are running the latest ruby 1.8 and rails 2.1
>> (will probably upgrade to 2.2 in the near future).

> I think you just answered your own question. The reason to use UTF-8
> would be to support other languages, especially languages that are not
> based on latin.

I thought UTF-8 was the default for HTML, and therefor the default for
The Web,
unless otherwise specified.

However, in the words of Joel Spolsky, "There is no such thing as plain
text".
If you chose not to decide which encoding to use, you still have made a
choice...

--
   Phlip
Will (Guest)
on 2008-12-09 04:06
(Received via mailing list)
Rails 2.x handles all text as UTF-8 by default. My question is if
mysql should be utf-8 as well. Is there any benefit leaving the mysql
database as latin1?
Richard M. (Guest)
on 2008-12-09 08:42
(Received via mailing list)
More and more MYSQL seems to be heading into needing to set your table
into the necessary language set. Some people suggest leaving it in
Latin has better performance etc, but I have been putting the data
into UTF-8 tables for compatibility, this seems to be the cleanest
when using MYSQL dumps and moving data to use the data in other
locations without all the characters getting screwed up.

But if you want to keep it in Latin you can, but I suggest not to.

Cheers

Richard
This topic is locked and can not be replied to.