Character sets in Konsole

Christian Mueller cmueller at gmx.de
Fri Feb 11 19:34:48 GMT 2005


Am Freitag, 11. Februar 2005 10:15 schrieb Hans-Michael Stahl:
> Christian Mueller wrote the following on 10.02.2005 22:28:
> 
> > It seems to me that the application produces iso-8859-1 characters 
> > that get (wrongly) reinterpreted as UTF-8 (see how the character 
> > following each umlaut is gobbled).   
> 
> That's a valid explanation.
> 
> > And the app does not seem to honour the LANG variable since 
> > the above did not help.
> 
> The app is monolingual. 


That doesn't keep the app from supporting the LANG variable, 
especially since UTF-8 contains all the ISO-8859-1 characters.



> But the same also happens when I simply display  
> a file (using cat, e.g.) containing iso-8859-1 or iso-8859-2 characters. 


I think that is not at all surprising.  How should konsole or any other 
program know the encoding of the files you feed them?   An app only 
sees a stream of bytes.  In order to interpret (and for example display)
them correctly you have to tell the apps what encoding to use.
That's why the LANG variable exists.  

There are also some apps that try to guess the encoding from 
the file's content but that's not 100% reliable. 



> > You could try the following (as a test): 
> > - Start a konsole 
> > - Type: export LANG="de_DE.ISO-8859-1"
> > - Start a second konsole from that environment
> > - In that second one, start your app and see what you get
> 
> That helped. It displays the special characters correctly in the forked 
> konsole. But I do no quite understand what is going on here :-(


Well, that was an educated guess.
If I understand correctly then the LANG setting of the environment 
konsole is started *from* determines the encoding konsole uses.  



> Am I right the konsole starts up UTF-8 mode by default? And why does it 
> so, invalidating the display of all files I have in 8-bit character 
> sets? 

Because someone told it to?  (Your distributor?  You, by accident?)

I don't know if the default is set in konsole itself.  It could be just 
as well a setting down in your distro's configuration that is 
"inherited" by KDE and konsole.  (That wouldn't explain why it works in 
xterm though...)

I have once heard about a setting in yast2 that switches the whole 
system to UTF-8.  I would take a look at the configuration you have 
there before trying to set this manually in .profile.  
Sorry I cannot be more specific but I don't have a SuSE system 
around. 

Or is what James Richard Tyler suggested a viable solution for you? 


Mit freundlichen Grüßen, 
Christian Müller.  

-- 

Der Kampf gegen die Dummheit hat gerade erst begonnen.
    -- Die Zeit
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde/attachments/20050211/a9c830f2/attachment.sig>
-------------- next part --------------
___________________________________________________
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.


More information about the kde mailing list