简体   繁体   中英

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

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

我降级到Ruby版本1.8.7

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM