Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .