How can I avoid putting the magic encoding comment on top of every UTF-8 file in Ruby 1.9?

后端 未结 7 2121
野的像风
野的像风 2020-12-13 18:30

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

7条回答
  •  长情又很酷
    2020-12-13 19:13

    I think you can either

    1. use -E utf-8 command line argument to ruby, or
    2. set your RUBYOPT environment variable to "-E utf-8"

提交回复
热议问题