I am using rails 3.1 and the asset pipeline (ruby 1.9.2).
I get the following error when trying to serve javascript js.erb file with utf-8 encoded strings
invalid byte sequence in US-ASCII
I set Encoding.default_external = "UTF-8" in the environment.rb file. How can I make the resource pipeline work with a different encoding?
EDIT
The error appears only when I generate the utf-8 character outside the file (in this case, by querying from the database). The error goes away if I add
<% "日" %>
to the beginning of the file. I guess some kind of coding is going on here, but how can I avoid this without this hacker solution?
spike Oct 13 2018-11-11T00: 00Z
source share