Bugzilla – Bug 52655
UTF-8 in xterm title
Last modified: 2006-04-26 13:51:36 UTC
Setting xterm title to utf-8 string via escape sequences does not work. It is one of the problems reported in bug 52542
<!-- SBZ_reproduce --> LANG=cs_CZ.UTF-8 in xterm in WindowMaker: echo -ne "\033]0;abcýöáädef\007" You get xterm title with broken or missing characters. The same works in konsole.
I can reproduce this with KDE. Might work only by accident in konsole. Mike needs to investigate this further. Anyway, this is minor IMHO ...
Mike. Only when time permits ...
This is windowmanager indepenendend and as as I see it not special to cs_CZ: LANG=de_DE.UTF-8 xterm -> echo -ne "\033]0;abcöädef\007" does not work either. It does not work with fvwm2 either.
Setting titles in KDE doesn't work at all. Probably KDE overwrites them again immediately. Anyway, it still seems not to be fixed with xterm-202. I've tested with fvwm2 (but this might be also a bug in fvwm2). changelog for xterm-201: * modify parsing of OSC (and SOS, etc), strings so their contents are not interpreted as UTF-8. This allows non-ASCII title strings to be set, provided that the window manager complies (report by Thomas Wolff).
The example in comment #1 works now, both with "echo" and with "xtermset": echo -ne "\033]0;abcýöáädef\007" xtermset -title "abcýöáädef" Tested under fvwm2-2.5.12. But it does not work anymore as soon as characters which are not in Latin-1 are involved, i.e. mfabian@magellan:~$ echo -ne "\033]0;ač\007" mfabian@magellan:~$ echo -ne "\033]0;a€\007" do *not* work.
Could be related to the following comment in the xterm sources (misc.c, line 2202): #if OPT_WIDE_CHARS /* * Title strings are limited to ISO-8859-1, which is consistent with the * printable data in sos_table. However, if we're running in UTF-8 mode, * it is likely that non-ASCII text in the string will be rejected because * it is not printable in the current locale. So we convert it to UTF-8, * allowing the X library to convert it back. */ if (xtermEnvUTF8()) {
In comment #6 I wrote that I tested under fvwm2 and it worked. But it doesn't work under KDE. With konsole and gnome-terminal it works just fine under FVWM2 *and* KDE, therefore I think this is not the fault of KDE but the fault of xterm.
sndirsch> Setting titles in KDE doesn't work at all. Probably KDE overwrites sndirsch> them again immediately. This is bcause our default prompt for bash looks like this: linux@rossini:~> echo $PS1 $(ppwd \l)\u@\h:\w> linux@rossini:~> which writes the current path in the title of the terminal. Therefore, the easiest way to check whether setting the titles doesn't works with our default settings is: mkdir äöü cd äöü
Add xterm author Thomas Dickey <dickey@herndon4.his.com> to CC: .
Actually "herndon4.his.com" has been obsolete for a while (can someone change this?). According to my rcs logs - I investigated it in mid-April with fvwm and had poor results (it worked one day, not the next - using the same stable copy of fvwm2 2.4.6). It happened to work for ion3 - which also required the conversion, and since this seems to be supported by _some_ window managers (google pointed to a couple more), and those that do seem to require the conversion, I left it in.
I revisited this one - Patch #210 - 2006/3/12 - XFree86 4.5.99.902 add utf8Title resource and menu entry, allowing the user to control whether title strings are interpreted as ISO-8859-1 or UTF-8 encoding (Novell #52655, #113206).
Thanks, Thomas. I'll update to xterm-212 for SL 10.2 next week.
Works, when enabling it via the menu entry, but I didn't succeed in setting it by the according XTerm resource (shouldn't it be 'XTerm.utf8-tile: true' or 'XTerm.utf8Title: true'?). Maybe you can help here. What about setting it to "uDefault" in the sources? Might this be problematic for some window managers?
The correct resource seems to be XTerm.utf8Title: 3 and the possible values seem to be 0, 1, 2, and 3, just like for the utf8 resource. The utf8Title resource is apparently not yet documented in the manual page.
Thanks, Mike. I'll use this setting by default by adding it to the app-defaults file. Fixed for SUSE 10.2 Alpha1.
utf8Title is a boolean, not an integer. (yes, I see that I forgot to add it to the manpage).
Thomas Dickey> utf8Title is a boolean, not an integer. Are you sure? We tried XTerm.utf8Title: true but it did't work. Then we tried XTerm.utf8Title: 1 and this did work. We were surprised and had a quick look at the source code and had the impression that it is an integer with values from 0 to 3. But of course we might be completely wrong here.
yes - I just checked. The relevant variable is screen->utf8_title, which is declared as a Boolean in ptyx.h (perhaps there's some bug to investigate, but that's what the variable is supposed to be).
Yes, I think there is a bug somewhere. With XTerm*utf8Title: true in the Xresources I get the warning on stdout: mfabian@magellan:~$ xterm Warning: Cannot convert string "true" to type Int mfabian@magellan:~$ and the UTF-8 Titles option is off (checked with Control+Rightmouse).
Created attachment 80266 [details] utf8-title-resource.patch I think the attached patch fixes the problem.
yes, that's right. I looked for that on Friday, but did not see it.
Thanks. We'll take the patch for now and will update to the next version ASAP to get rid of it again.