| Class | ActionController::Base |
| In: |
lib/localization_simplified.rb
|
| Parent: | Object |
Modify Actioncontroller to always use UTF-8 Currently this modifies MySQL. Please add other databases you find necessary
# File lib/localization_simplified.rb, line 197
197: def configure_charsets(charset='utf-8')
198: $KCODE = 'u'
199: # Response header necessary with some lang-files (like lang_pirate.rb for some reason)
200: @response.headers["Content-Type"] = "text/html; charset=utf-8"
201:
202: # Set connection charset. MySQL 4.0 doesn't support this so it
203: # will throw an error, MySQL 4.1 needs this
204: suppress(ActiveRecord::StatementInvalid) do
205: ActiveRecord::Base.connection.execute 'SET NAMES UTF8'
206: end
207: end