我可以通过在其顶部添加注释行来指定任何ruby文件以使用特定编码:
#encoding: utf-8
Run Code Online (Sandbox Code Playgroud)
但是在Rails中config/application.rb,我发现了这个:
config.encoding = "utf-8"
Run Code Online (Sandbox Code Playgroud)
他们不一样吗?如果我已经设定config.encoding = "utf-8",我还需要#encoding: utf-8吗?