[Konsole-devel] escape sequences to control encoding, and to query encoding

Robert Knight robertknight at gmail.com
Mon Dec 4 21:30:52 UTC 2006


Hello Yakov,

Each session (or tab) in Konsole can have a different encoding - but
the LANG variable isn't affected.  The encoding is only used to
convert the incoming character stream from the terminal program into a
Qt string which can be drawn on screen.  When I said "current system
locale", I meant the locale that is used by default for all KDE
applications.

As with any Unix application, Konsole can only pass environment
variables to a process when it is created.  After that it cannot read
or modify them - although the child process itself can.

> The escape sequences that you gave me, they allow for case (1)
> but not for case (2) (querying is missing).

Do you know the escape sequence used by other terminals for querying /
setting encoding or better, if there is any official 'standard'
sequence which is supported by at least one other terminal that could
be used for this?

Regards,
Robert.



On 04/12/06, Yakov Lerner <iler.ml at gmail.com> wrote:
> Thanks Robert.
> The use case is switching the encodings in vim. Sometimes, I
> want utf8 in vim, sometimes latin1. Ideally, I want to
> vim and konsole be synchronized automatically. Two cases here:
>
> (1) change of encoding via vim setting (utf8<->latin1) would change
> encoding of the konsole tab
>
> (2) change of encoding in konsole (utf8<->latin1) tab would
> vim to detect it and to set correct it's vim setting of encoding (via quering).
>
> The escape sequences that you gave me, they allow for case (1)
> but not for case (2) (querying is missing).
>
> BTW do I understand it correct that different tabs of konsole can
> have different encodings ? If this is correct, I don't follow logic of
> 'current system locale' that you mention. Different tabs can have
> different LANG setting and correspondingly different konsole encodings,
> correct ? The 'current system locale' is per-process, no ?
>
> When you mean  'current system locale', do yuo mean $LANG
> at the time when konsole process was started ? Can't it's
> subshells subsequently change their $LANG ?
>
> Thanks
> Yakov
>
> On 12/4/06, Robert Knight <robertknight at gmail.com> wrote:
> > Hello,
> >
> > Konsole supports an escape sequence to select either UTF8 or the
> > appropriate codec for the current system locale.  ESC-CS-%G for UTF8
> > and ESC-CS-%@ for the system locale.  There is no escape sequence for
> > setting specific codecs or querying the current codec however.
> >
> > Konsole supports 256 colours, but not 24-bit colour values.
> >
> > What is the use case you had in mind?
> >
> > Regards,
> > Robert.
> >
> > On 04/12/06, Yakov Lerner <iler.ml at gmail.com> wrote:
> > > Hello,
> > > Does konsole have escape sequences to (1) switch/set
> > > current encoding, and to (2) query current encoding ?
> > >
> > > Also, does konsole support full 24-bit color like urxvt does ?
> > >
> > > Thanks
> > > Yakov
> > > _______________________________________________
> > > konsole-devel mailing list
> > > konsole-devel at kde.org
> > > https://mail.kde.org/mailman/listinfo/konsole-devel
> > >
> > _______________________________________________
> > konsole-devel mailing list
> > konsole-devel at kde.org
> > https://mail.kde.org/mailman/listinfo/konsole-devel
> >
> _______________________________________________
> konsole-devel mailing list
> konsole-devel at kde.org
> https://mail.kde.org/mailman/listinfo/konsole-devel
>



More information about the konsole-devel mailing list