8

I have some issues with the encoding of german umlauts in bash. It mostly is working fine, but when i am typing a invalid command, the error message generated by bash contains strange escape sequences and not the actual characters.

Here is a log, which shows the problem:

[root@myhost ~]# mkdir ä
[root@myhost ~]# ä
-bash: $'\303\244': Kommando nicht gefunden.
[root@myhost ~]# ü
-bash: $'\303\274': Kommando nicht gefunden.
[root@myhost ~]# ls
ä  äöü  Projects  tbb
[root@myhost ~]# cat äöü
äüö
[root@myhost ~]# rm ä
rm: Entfernen von „ä“ nicht möglich: Ist ein Verzeichnis
[root@myhost ~]# rmdir ä
[root@myhost ~]# rm äöü

the configuration of my /etc/rc.conf:

LOCALE="de_DE.UTF-8"
DAEMON_LOCALE="no"
HARDWARECLOCK="localtime"
TIMEZONE="Europe/Berlin"
KEYMAP="de-latin1"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"

/etc/locale.gen only contains the de_DE locales:

de_DE.UTF-8 UTF-8
de_DE ISO-8859-1
de_DE@euro ISO-8859-15

locale output:

LANG=de_DE.UTF-8
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=
4
  • What terminal emulator are you using? Nov 29, 2011 at 22:40
  • @RomanB: putty, but the problem is the same if use the raw shell locally, so this is a bash issue.
    – smerlin
    Nov 29, 2011 at 23:52
  • @smerlin, there is no "the raw shell", do you mean the console, gnome-terminal, urxvt, xterm or another? If you use the console, what happens if you try "export TERM=linux"?
    – Alexander
    Dec 2, 2011 at 14:45
  • 1
    @Alexander The same: $ ö bash: $'\303\266': command not found Dec 15, 2011 at 23:56

1 Answer 1

2

This seems to be introduced with bash 4.2. You can report this as a bug to the bash developers.

1
  • I agree. It is spliting up the unicode character into its component bytes, so its Unicode handling is off.
    – jpaugh
    Jan 23, 2012 at 5:57

You must log in to answer this question.

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