We all know the "magical"
# encoding: utf-8
line. But I've seen several other alternative notations, some of them pretty wild. Do you know or use any of those? Is there some more general rule of what is acceptable?
Edit: Ok, apparently there are exactly 3 ways:
# encoding: UTF-8
# coding: UTF-8
# -*- coding: UTF-8 -*-
(more at http://blog.grayproductions.net/articles/ruby_19s_three_default_encodings)
No, there are not "exactly 3 ways" to specify the 'magic comment' -- there are an infinite number of them. Any comment on the first line that contains
coding:
will work, according to JEG2:So, any of these should work: