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=
  • What terminal emulator are you using? – Roman B. Nov 29 '11 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 '11 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 '11 at 14:45
  • @Alexander The same: $ ö bash: $'\303\266': command not found – Roman B. Dec 15 '11 at 23:56
1

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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