Magic encoding is a great tool to convert files to a specific encoding, but I don’t like the Emacs comments style, so…
gem install magic_encoding_just_for_ruby
you can call the tool from the console with default parameters like so
magic_encoding
this will prepend every “.rb” file in the working directory (recursively) with the following line :
# encoding : utf-8
Notes :
-
existing magic comments are replaced
-
the rest of the file remains unchanged
-
maybe utf-8 is the only encoding we need