I came across some Ruby scripts on Github. The first line is the normal shebang (#!/usr/bin/ruby), but the second line is the following:

# -*- coding: utf-8 -*-

I didn't know this method of declaring character encoding! Is this just a Ruby thing, or can I use it (for example) in Bash scripts as well?

link|improve this question

75% accept rate
feedback

1 Answer

up vote 4 down vote accepted

That's actually the emacs way of defining character encoding.

It's not just a Ruby thing as Python understands it too. But, Bash knows nothing of it.

link|improve this answer
Thanks! :) Voted up. – Zearin Jul 1 '11 at 16:25
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.