KDE Konsole and umlauts

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....
Post Reply
User avatar
^rooker
Site Admin
Posts: 1484
Joined: Fri Aug 29, 2003 8:39 pm

KDE Konsole and umlauts

Post by ^rooker »

[PROBLEM]
I just ran into an umlaut-problem, again. *sigh*

The umlaut within a filename was displayed as question mark "?". I'm using bash, so doing a "ls -b *" revealed the character code "\366".

I've tried changing the terminal encoding between UTF-8 and ISO-8859-1, as well as the $LANG environment variable. The only thing that changed was that a box was displayed instead of a question mark. :?

(Unfortunately, I wasn't able to simply use "\366" instead of that character)


[SOLUTION]
The file was created by someone using the "de_DE.ISO-8859-1" locale, and I was using "en_US.UTF-8". great.

Now both, the $LANG environment variable and the terminal encoding must be changed (and should match each other).

So I did:

Code: Select all

export LANG=de_DE.ISO-8859-1
...and then changed KDE's Konsole encoding (from Default to):

Code: Select all

Settings > Encoding > Western European (iso-8859-1)
User avatar
^rooker
Site Admin
Posts: 1484
Joined: Fri Aug 29, 2003 8:39 pm

Changing character encoding

Post by ^rooker »

In order to get rid of non-unicode characters once and for all, you should change their encoding.

but how?

Here's a (maybe brute) way to do it:

1) Change your terminal's encoding and $LANG variable to match the special character's encoding. e.g. "de_DE.ISO-8859-1"

2) Now rename the file to be free of any special characters.

3) Reset your terminal's encoding and $LANG variable to proper unicode. e.g. "de_DE.UTF-8"


Maybe quick and dirty, but standards-compliant because it works on almost any system without the need for a special tool.
Post Reply