I'm using rails 3.1 and the asset pipeline (ruby 1.9.2).
I get the following error when trying to serve a javascript js.erb
file that has utf-8 encoded strings
invalid byte sequence in US-ASCII
I've set Encoding.default_external = "UTF-8"
in my environment.rb file. How do i get the asset pipeline to serve with a different encoding?
EDIT
The error only shows up when I'm generating the utf-8 character outside of the file (in this case by querying from the DB). The error goes away if I add
<% "日" %>
to the top of the file. I'm guessing there's some kind of encoding guessing going on here, but how do I avoid it without that hacky solution?