7

Is there a way to configure bash on Linux (red hat and ubuntu) to allow shell scripts to be encoded in UTF-8?

I can't find a simple way to change just one little thing and have the whole system just use UTF-8 files without having to worry about encoding.

sal
  • 827
  • 3
  • 12
  • 18

3 Answers3

6

I'm fairly sure bash pays attention to your locale setting, so if it's UTF-8, you should be good to go.

pjz
  • 10,595
  • 1
  • 32
  • 40
4

As long as you don't use the UTF-8 BOM, you should be ok.

leonbloy
  • 2,118
  • 17
  • 23
  • 2
    Bizarre that UTF-8 permits a BOM (byte order mark) at start of file, but it's true: http://unicode.org/faq/utf_bom.html#bom5 - as you imply, any use of this would confuse many applications such as shells. – RichVel Sep 05 '11 at 09:35
1

You shouldn't have to do anything, it's always worked automatically for me.

Amandasaurus
  • 31,471
  • 65
  • 192
  • 253