I have a Rails project with a lot of Cyrillic strings in it.
It worked fine on Ruby 1.8, but Ruby 1.9 assumes source files are US-ASCII-encoded unless you provide a
In my opinion, explicit is not always better than implicit.
When almost all the source you use is UTF-8 compatible, you can easily avoid putting the magic encoding comment by using Ruby's -Ku command-line options.
Don't confuse the "u" parameter of the -K options with -U options.
-Ku : set internal and script encoding to utf-8
-U : set internal encoding to utf-8
Then, set the magic encoding comment only in scripts that need it. Remember, convention over configuration!
You can set the environment variable RUBYOPT=-Ku
See Ruby's command-line options at http://www.manpagez.com/man/1/ruby/.