0

According to the ruby guide we have decided to use which can be found here it seems like it's a very good idea to specify the encoding of a gem and the source files within the gem. My question is does:

# -- encoding: utf-8 --

At the top of a gemspec filter through all the files in the gem or should it be specified in each file for completeness?

I would hope it filters throughout the files in the gem but would rather ask and be safe than sorry!!

I also looked at:

How does the magic comment ( # Encoding: utf-8 ) in ruby​​ work?

and

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

According to the later link there is no way to ensure this short of putting it in every file but I wondered whether the gemspec declaration was special in some way??

Thanks in advance for any help.

4

1 回答 1

1

文件编码标头指定该文件的编码。它没有指定其他文件的编码。怎么可能?

于 2013-04-26T14:04:53.420 回答