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

后端 未结 7 2080
野的像风
野的像风 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:15

    There's a gem that sets the magic comment on top on every file that needs it in a Rails project : https://github.com/m-ryan/magic_encoding

    You just install it and run magic_encoding in the root of your project, problem solved.

    0 讨论(0)
提交回复
热议问题