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.
96b9b2437a5f2676c2861f0fedf3afac?d=identicon&s=25 Will (Guest)
on 2008-12-08 05: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
280b78a61a968391b7e07e912be102a8?d=identicon&s=25 Robert Walker (robert4723)
on 2008-12-08 15: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.
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2008-12-08 16:00
(Received via mailing list)
Robert Walker 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
96b9b2437a5f2676c2861f0fedf3afac?d=identicon&s=25 Will (Guest)
on 2008-12-09 03: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?
Ad97d898eefbb44ba50c07ee8554781b?d=identicon&s=25 Richard Mcintyre (mackstar)
on 2008-12-09 07: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.