I have a Rails project (version 3.2.1) and I recently switched from Ruby 1.8.7 to Ruby 1.9.3. I have added code comments in all .rb and .erb , but I have a problem with the usual JavaScript .js attributes. They contain comments in Polish saved with the UTF-8 encoding. It works fine in most files - Ruby correctly defines the encoding, but in one file I have only one UTF-8 character ś in the comment line. And now the Rails server fails with Encoding::CompatibilityError when displaying the index page (which doesn't even reference the JavaScript file).
I know that this is a problem with detecting Ruby's automatic encoding, since it probably cannot detect a single-character encoding outside the ASCII range, but it is very frustrating, because in any case it does not matter - the file is associated only with the asset.
My question is: how to provide UTF-8 encoding in all .js assets?
source share