Rails view error "invalid byte sequence in US-ASCII" error after upgrading Ruby to 1.9.2

Posted by Jon on Stack Overflow See other posts from Stack Overflow or by Jon
Published on 2010-12-29T15:47:36Z Indexed on 2010/12/29 19:54 UTC
Read the original article Hit count: 146

Filed under:
|
|
|

Running Rails 2.3.9 and just upgraded to Ruby 1.9.2p0. I have been putting:

# encoding: utf-8

in a bunch of my .rb files where ever "£" character is used, and this seems to be working. But i just got my first view error:

invalid byte sequence in US-ASCI

for this line of code:

<%= number_to_currency(product.price, :unit => "£", :precision => 0) %>

I don't think its a coincidence that the "£" character is involved again. Any ideas on how to solve this please?

Thanks

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby