logo       

Re: ActiveSupport::Multibyte for better Unicode support: msg#00163

lang.ruby.rails.core

Subject: Re: ActiveSupport::Multibyte for better Unicode support



On 21/09/2006, at 12:15 AM, DHH wrote:

>> We would like to see ActiveSupport::Multibyte included in Rails so
>> that developers can start depending on it for simpler and better
>> Unicode support.
>
> I concur. Let this start an official request for comments. Any
> objections to getting this into core?

I'm definitely in favour of seeing something like this in core.
Better unicode handling is needed yesterday! The chars proxy is a
very nice way of handling this.

A question:

How does this compare to the unicode_hacks plugin? (See http://
julik.textdriven.com/svn/tools/rails_plugins/unicode_hacks/) They
seem very similar in both intent and interface.

Some comments:

Even with this plugin, supporting unicode in a Rails app is too
complicated and fiddly. For those who haven't tried it, here are the
steps:

- Make sure your database character set is utf8
- Make sure all your tables have a character set of utf8
- Make sure your database.yml has 'encoding: utf8' set for each database
- Put $KCODE='u' in your environment.rb
- Add an after_filter to application.rb to set the Content-Type
header correctly
- Add 'normalize_unicode_params :form => :kc' to your application.rb

Missing one of these steps can produce strange results and corrupted
data.

If unicode support is being included in core, then this needs to be
rationalised. Ideally a single setting in environment.rb should take
care of all of this. I also think it should be enabled by default.
(Who doesn't want to support unicode nowadays?)

Rumour also has it that ActiveRecord, when recreating timed-out
database connections, doesn't honour the 'encoding: utf8' setting.
I've never run into this personally, so I assume it was fixed at some
point?

Cheers,

Pete Yandell

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to rubyonrails-core@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
rubyonrails-core-unsubscribe@xxxxxxxxxxxxxxxx
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core
-~----------~----~----~----~------~----~------~--~---




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise