Bug 138742 - Escape sequence for querying, setting encoding
Summary: Escape sequence for querying, setting encoding
Status: RESOLVED WORKSFORME
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-13 12:34 UTC by Yakov Lerner
Modified: 2012-01-24 13:44 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yakov Lerner 2006-12-13 12:34:54 UTC
Version:            (using KDE KDE 3.5.3)
Compiler:          gcc 4.0.2 
OS:                Linux

Please support escape sequence for querying the encoding of the current tab, and escape sequence for setting encoding of the current tab.

Note that this does not affect locale of konsole, only the encoding in the current tab.

Setting and querying global locale of the konsole would be another pair of escape-sequences, unrealted to the sequences for querying and setting the encoding of a single tab.

For comparison, urxvt does not have sequences for querying and changing encoding of current tab. But that because urxvt does not have different encodings for its tab (which is an omission on part of urxvt which is advantage of konsole).  Urxvt have different feature -- the sequence for querying and setting global locale of urxvt [1]. But this feature is different from requested feature because it affects all tabs.

[1] urxvt reference [2] describes sequence for querying and setting
    locale of urxvt, this affects all tabs and is different from
    the requested feature.

  "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 http://www.penguin-soft.com/penguin/man/7/urxvt.html
Comment 1 Philip Rodrigues 2006-12-13 22:17:16 UTC
Wish, right?
Comment 2 Robert Knight 2007-02-10 04:44:00 UTC
Confirmed following discussion on mailing list.
Comment 3 Jekyll Wu 2011-10-05 03:17:18 UTC
In the KDE4 konsole, the konsoleprofile utility can be used to change the encoding of current tab, for example:

$ konsoleprofile DefaultEncoding=GBK
Comment 4 Jekyll Wu 2012-01-23 13:19:46 UTC
Or, use the related dbus methods :

$ qdbus org.kde.org konsole /Sessions/1  codec
UTF-8

$ qdbus org.kde.org konsole /Sessions/1  setCodec GBK
true

You can get the needed dbus parameters corresponding to current tab by looking at environment variable $KONSOLE_DBUS_SERVICE and $KONSOLE_DBUS_SESSION.
Comment 5 Jekyll Wu 2012-01-24 13:44:32 UTC
I think the dbus methods in comment #4 are good enough. Feel free to reopen if you think they are not good enough to satisfy your need.