Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a file I've called æøå.js (just an example), and when I run ls in the directory where it's stored I get

root@chu:~/projects/someproject/server# ls src
a.js  b.js  ??????.js

So it seems such symbols can't be displayed. PuTTY is set to expect UTF-8, and my env looks like this

TERM=xterm
SHELL=/bin/bash
USER=root
LANG=en_GB.UTF-8
SHLVL=1
HOME=/root
LANGUAGE=en_US:en
LS_OPTIONS=--color=auto
PYTHONPATH=:/root/pymodules
LOGNAME=root
_=/usr/bin/env

(I've removed some stuff from that output since they can't possibly be relevant anyway)

But here's the thing; When I open a file with vim then I can type and see all those symbols without a problem. So the problem is apparently just in the shell/bash. Are there any settings I can supply that will allow bash to display those symbols? Can someone also explain why it doesn't work now, with UTF-8?


Edit: This is how tree displays æøå.js

|-- src
|   |-- a.js
|   |-- b.js
|   `-- \303\246\303\270\303\245.js
share|improve this question

1 Answer 1

up vote 7 down vote accepted

As I already explained, twice, in our earlier discussion, the problem is that your locale configuration is pointing to a nonexistent locale.

Your environment including $LANG is okay; however, the en_GB.UTF-8 locale must be generated.

On most distributions (including Debian):

  1. Open /etc/locale.gen in a text editor.
  2. Uncomment the en_GB.UTF-8 line by removing the leading #.
  3. Run locale-gen as root.

On Debian:

  1. Run dpkg-reconfigure locales as root.
  2. Scroll down to the "en_GB.UTF-8" entry, mark it with Space.
  3. Select OK with Tab, Enter.

Also, for the record, ls is a separate program; it is not part of bash.

share|improve this answer
    
Ah yes, I didn't think this question was related. Also I asked this question before you solved my previous one :-) ls displays the symbols correctly now and I'll mark your answer as correct. tree however, working correctly in every other way, displays the file as \303\246\303\270\303\245.js. Is that fixable? –  Hubro Jan 14 '12 at 20:04
    
That might depend on the version of tree, actually. I compiled 1.6.0 (latest) and 1.5.3 (Debian squeeze) on the same system, and 1.6.0 displays Unicode while 1.5.3 uses octal. –  grawity Jan 14 '12 at 20:29
    
Good catch. I installed version 1.6.0 and it displays everything correctly. Thanks a million once again for your help! :-) –  Hubro Jan 14 '12 at 20:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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