diff --git a/railties/CHANGELOG b/railties/CHANGELOG index eb18007d300086991d334792ee05f3df250180f4..634caf4ffb39bd1712122852776d71d0b1f5e967 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Set $KCODE to 'u' by default to enable the multibyte safe String#chars proxy. [Koz] + * Added config.plugins to control which plugins are loaded #6269 [skaes]. By default, everything in vendor/plugins will be loaded, but if you specify config.plugins, only those will be loaded. Example: config.plugins = %w[ routing_navigator simply_helpful ] diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index 1400930768430bc8959863d569b25c604208d9c0..ba651a2a035e7c714817344c021e8b5d1eeb83ee 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -83,6 +83,7 @@ def process set_autoload_paths load_environment + initialize_encoding initialize_database initialize_logger initialize_framework_logging @@ -197,6 +198,13 @@ def load_observers ActiveRecord::Base.instantiate_observers end + # This initialzation sets $KCODE to 'u' to enable the multibyte safe operations. + # Plugin authors supporting other encodings should override this behaviour and + # set the relevant +default_charset+ on ActionController::Base + def initialize_encoding + $KCODE='u' + end + # This initialization routine does nothing unless :active_record # is one of the frameworks to load (Configuration#frameworks). If it is, # this sets the database configuration from Configuration#database_configuration