Reputation: 18279
I just upgraded to Rails 3 and Ruby 1.9. All of my source files that used Unicode inside of them (such as emdashes) caused problems until I found out that you now need to include the following magic comment on top of each source file:
# encoding: utf-8
Is there a better way to do this? It'd be nice if it just automatically treated every source file as utf-8 like Rails 2.3/Ruby 1.8 did, and I don't see any apparent disadvantage from doing so.
In my application.rb I already have the following, but I can't tell that it does anything:
config.encoding = "utf-8"
Upvotes: 6
Views: 1362
Reputation: 474
i found only rake check_encoding_headers
it add the magic comment to all files.
Upvotes: 4