From: "Bartosz Dziewoński" Date: 2012-06-06T20:26:29+09:00 Subject: Re: Magic comments justification The encoding has to be set *before the file is even parsed*. So obviously you can't use a regular method call to do this; this basically forces you to create new syntax for setting the encoding. However, you also want to keep backwards compatibility when possible – so you make that new syntax look like comments for older Ruby versions. Bam, you've got a magic encoding comment. -- Matma Rex