Rails view error "invalid byte sequence in US-ASCII" error after upgrading Ruby to 1.9.2
- by Jon
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