views:

13

answers:

0

I upgraded to RoR 3.0.1 and Ruby to 1.9.2. Now all the strings in my views are ASCII-8BIT?

I believe I have my app set up to use UTF 8

application.rb

config.encoding = "utf-8"

database.yml

development:
  adapter: mysql
  encoding: utf8

I'm running

OS X
RVM rvm 1.0.16 
Ruby ruby-1.9.2-p0
Rails 3.0.1

I'd expect that the enoding would be UTF 8 not ASCII

business.desc.encoding
# ASCII-8BIT

Since 1.9.x can concatenate strings of different encodings we see a lot of errors like this.

<p class="description"><%= truncate(business.desc, :length => 17) %></p>

The Error

incompatible character encodings: ASCII-8BIT and UTF-8

activesupport (3.0.1) lib/active_support/core_ext/string/output_safety.rb:74:in `concat'
activesupport (3.0.1) lib/active_support/core_ext/string/output_safety.rb:74:in `concat'
actionpack (3.0.1) lib/action_view/template/handlers/erb.rb:14:in `<<'
app/views/browse/businesses.html.erb:15:in `block in _app_views_browse_businesses_html_erb___1616718260917998189_2173630500__1134905695726531092'
app/views/browse/businesses.html.erb:3:in `each'
app/views/browse/businesses.html.erb:3:in `each_with_index'
app/views/browse/businesses.html.erb:3:in `_app_views_browse_businesses_html_erb___1616718260917998189_2173630500__1134905695726531092'

Does anyone else have this problem? Is ruby-1.9.2-p0 the correct version to use?

Thanks!