KDE

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • escape sequences to control encoding,and to query encoding

    6 answers - 297 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    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 (DOT) org
  • No.1 | | 867 bytes | |

    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.

    04/12/06, Yakov Lerner <iler.ml (AT) gmail (DOT) comwrote:
    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 (DOT) org

    konsole-devel mailing list
    konsole-devel (AT) kde (DOT) org
  • No.2 | | 2200 bytes | |

    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

    12/4/06, Robert Knight <robertknight (AT) gmail (DOT) comwrote:
    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.

    04/12/06, Yakov Lerner <iler.ml (AT) gmail (DOT) comwrote:
    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 (DOT) org

    konsole-devel mailing list
    konsole-devel (AT) kde (DOT) org

    konsole-devel mailing list
    konsole-devel (AT) kde (DOT) org
  • No.3 | | 3326 bytes | |

    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.

    04/12/06, Yakov Lerner <iler.ml (AT) gmail (DOT) comwrote:
    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

    12/4/06, Robert Knight <robertknight (AT) gmail (DOT) comwrote:
    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.

    04/12/06, Yakov Lerner <iler.ml (AT) gmail (DOT) comwrote:
    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 (DOT) org

    konsole-devel mailing list
    konsole-devel (AT) kde (DOT) org

    konsole-devel mailing list
    konsole-devel (AT) kde (DOT) org

    konsole-devel mailing list
    konsole-devel (AT) kde (DOT) org
  • No.4 | | 508 bytes | |

    12/4/06, Robert Knight <robertknight (AT) gmail (DOT) comwrote:
    --
    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?

    I'll search for existing practice. I'll let you know results of my search.

    Yakov

    konsole-devel mailing list
    konsole-devel (AT) kde (DOT) org
  • No.5 | | 1059 bytes | |

    12/4/06, Robert Knight <robertknight (AT) gmail (DOT) comwrote:

    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?

    Hello Robert,
    urxvt has escape sequence to query and change urxvt's locale.
    However, it is different because it affects urxvt's locale *and*
    encoding of all urxvt tabs [1]. Urxvt's sequence seems to me
    urxvt-specific and not coming from any "standard". I did not find
    anything else.

    Yakov

    [1] urxvt reference has [2]:

    "ESC ] Ps;Pt ST"
    Ps = 701 Change current locale to Pt, or,
    if Pt is ?, return the current locale (Compile frills).
    # change the locale and tell rxvt-unicode about it
    export LC_CTYPE=ja_JP.EUC-JP; printf "\33]701;$LC_CTYPE\007"

    [2] 'man 7 urxvt' or

    konsole-devel mailing list
    konsole-devel (AT) kde (DOT) org
  • No.6 | | 1452 bytes | |

    Hello Yakov,

    Could you file a wishlist bug report against Konsole ( on bugs.kde.org
    ) to add this in future with the details of urxvt's extensions.

    Regards,
    Robert.

    07/12/06, Yakov Lerner <iler.ml (AT) gmail (DOT) comwrote:
    12/4/06, Robert Knight <robertknight (AT) gmail (DOT) comwrote:

    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?
    --
    Hello Robert,
    urxvt has escape sequence to query and change urxvt's locale.
    However, it is different because it affects urxvt's locale *and*
    encoding of all urxvt tabs [1]. Urxvt's sequence seems to me
    urxvt-specific and not coming from any "standard". I did not find
    anything else.

    Yakov

    [1] urxvt reference has [2]:

    "ESC ] Ps;Pt ST"
    Ps = 701 Change current locale to Pt, or,
    if Pt is ?, return the current locale (Compile frills).
    # change the locale and tell rxvt-unicode about it
    export LC_CTYPE=ja_JP.EUC-JP; printf "\33]701;$LC_CTYPE\007"

    [2] 'man 7 urxvt' or

    --

    konsole-devel mailing list
    konsole-devel (AT) kde (DOT) org

    >
    >
    >


    konsole-devel mailing list
    konsole-devel (AT) kde (DOT) org

Re: escape sequences to control encoding,and to query encoding


max 4000 letters.
Your nickname that display:
In order to stop the spam: 5 + 5 =
QUESTION ON "KDE"

EMSDN.COM