Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #8701 (closed enhancement: fixed)

Opened 1 year ago

Last modified 1 year ago

[PATCH]add utf8 encoding to the default database.yml file (mysql)

Reported by: matt Assigned to: core
Priority: normal Milestone: 1.x
Component: Railties Version: edge
Severity: normal Keywords:
Cc:

Description

The recently added rake task db:create ( #8448 ) creates utf-8 databases based on the settings in your database.yml file.

However, mysql requires you to mention the encoding to properly display utf-8 data. (Chinese for instance).

This patch adds a default utf-8 encoding to the autogenerated database.yml file created for you.

Attachments

add_utf8_encoding_by_default_to_mysql_adapter.diff (0.7 kB) - added by matt on 06/20/07 18:19:25.
add utf8 encoding to the default autogenerated database.yml file for mysql
add_utf8_encoding_to_mysql_postgres.diff (1.5 kB) - added by matt on 06/20/07 22:15:29.

Change History

06/20/07 18:19:25 changed by matt

  • attachment add_utf8_encoding_by_default_to_mysql_adapter.diff added.

add utf8 encoding to the default autogenerated database.yml file for mysql

06/20/07 18:21:21 changed by matt

  • type changed from defect to enhancement.
  • component changed from ActiveRecord to Railties.
  • summary changed from add utf8 encoding in the default database.yml file (mysql) to [PATCH]add utf8 encoding in the default database.yml file (mysql).

06/20/07 18:25:50 changed by matt

  • summary changed from [PATCH]add utf8 encoding in the default database.yml file (mysql) to [PATCH]add utf8 encoding to the default database.yml file (mysql).

06/20/07 21:50:16 changed by manfred

+1, the rest of Rails is all UTF-8. Matt, can you also add encoding: unicode to the Postgres database.yml file and add it to your patch?

06/20/07 22:15:29 changed by matt

  • attachment add_utf8_encoding_to_mysql_postgres.diff added.

06/20/07 22:17:24 changed by matt

I was under the impression that Postgres didn't need that since it was utf-8 by default but I added another patch for both mysql and postgres

Matt Aimonetti

06/21/07 16:22:37 changed by matt

  • owner changed from bitsweat to core.

Does anyone know if sqlite, oracle and other adapters require the encoding to me defined to work properly with utf8?

06/21/07 17:07:49 changed by manfred

SQLite defaults to everything UTF-8, connection, tables, everything.

06/22/07 16:19:25 changed by matt

06/25/07 18:01:19 changed by bitsweat

  • status changed from new to closed.
  • resolution set to fixed.

(In [7116]) MySQL, PostgreSQL: database.yml defaults to utf-8. Closes #8701.