Re: UTF-8 in title not working

"Zvi Har'El" <[email protected]> Wed, 16 Jan 2008 23:43:56 +0200
Newsgroups gmane.comp.gnu.screen
Organization Technion--Israel Institute of Technology
Message-ID <478E7A9C.6040403__24470.2602657073$1238088983$gmane$org@math.technion.ac.il>

On 04/01/08 21:46, Nikolai Weibull wrote:

> Is there a way to get screen to output UTF-8 in a title?
>
> I've tried, for example, <Esc>klong…title<Esc>\, but
> that just comes out garbled.
>
> I'm using 4.00.03.
>
> Thanks!
>
>
> _______________________________________________
> screen-users mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/screen-users
>   
I have written about this last year, and got no satisfactory answer.  
Here is my last post, From August:

> This is already an old thread, that I started in February, and got 
> Alexander Kriegisch's response in March and Michael Schroeder's response
> in April. The question was about displaying UTF-8 characters in the
> window title when it is used as the screen hard status line (see full
> post below).  I am still not satisfied with the situation. Since xterm
> has a special vt100 widget resource named *utf8Title*, which is
> described as follows:
>
>   
>> >  utf8Title (class Utf8Title)
>> >                Applications can  set  xterm's  title  by  writing  a 
>> > control
>> >                sequence.   Normally  this  control sequence follows
>> > the VT220
>> >                convention, which encodes the string in ISO-8859-1 and 
>> > allows
>> >                for  an  8-bit  string  terminator.   If xterm is
>> > started in a
>> >                UTF-8 locale, it translates the ISO-8859-1 string to
>> > UTF-8  to
>> >                work with the X libraries which assume the string is UTF-8.
>> >
>> >                However,  some  users may wish to write a title string
>> > encoded
>> >                in UTF-8.  Set  this  resource  to  ``true''  to 
>> > allow  UTF-8
>> >                encoded title strings.  That cancels the translation to
>> > UTF-8,
>> >                allowing UTF-8 strings to be displayed as is.
>> >
>> >                The default is ``false.''
>> >
>>     
> I am using this to display UTF-8 titles in xterm (e.g., my current
> directory, which is encoded in UTF-8). We might have a similar option in
> screen, which sends the characters to the  X libraries with no
> translation, so that  it is displayed correctly.
>
> II am not wrong, this should not be a major change.
>
>
> On 23/04/07 21:28, Michael Schroeder wrote:
>
>   
>> > On Wed, Mar 28, 2007 at 12:04:09PM +0200, Zvi Har'El wrote:
>> >   
>>     
>>> >> Comparing Unicode, it replaces U+03B1 GREEK SMALL LETTER ALPHA with 
>>> >> U+00B1 PLUS-MINUS SIGN and so on, i.e, the Unicode  values seem to be
>>> >> taken modulo U+0100.
>>> >>     
>>>       
>> >
>> > Yes, it's because StringChar() in ansi.c discards the upper bits.
>> > To fix this bug we'd have to change the way the string gets stored.
>> > Note that we can't just simply transcode to the display's encoding,
>> > as the window may be displayed on multiple displays with different
>> > encodings...
>> >
>> > Cheers,
>> >   Michael.
>> >
>> >   
>>     
> Here is my original posting:
>
>   
>> > Hi,
>> >
>> > I am using Screen in a en_US.UTF-8 locale, inside an xterm. I am using
>> > the xterm standard escape sequence to set the window title.  I have a
>> > the following problem: There is no problem with the Basic Latin
>> > (ASCII) characters (Unicode <  0+007F), but also with Latin1
>> > Supplement characters (U+0080 <= Unicode < U+00FF), are displayed OK.
>> > However, other characters are displayed incorrectly: for example, the
>> > command
>> >
>> >
>> > echo '\e]0;αβγ\a\c'
>> >
>> >
>> > in a normal Xterm shows the title
>> >
>> >
>> > αβγ
>> >
>> >
>> > but in screen version 4.00.03jw4 (FAU) 2-May-06 (from the CVS) show
>> > the title
>> >
>> >
>> > ±²³
>> >
>> >
>> > Comparing Unicode, it replaces U+03B1 GREEK SMALL LETTER ALPHA with 
>> > U+00B1 PLUS-MINUS SIGN and so on, i.e, the Unicode  values seem to be
>> > taken modulo U+0100.
>> >
>> >
>> > Cheers,
>> >
>> >
>> > Zvi.
>>     
>
> -- Dr. Zvi Har'El mailto:[email protected] Department of 
> Mathematics tel:+972-54-4227607 Technion - Israel Institute of 
> Technology fax:+972-4-8293388 http://www.math.technion.ac.il/~rl/ 
> Haifa 32000, ISRAEL "If you can't say somethin' nice, don't say 
> nothin' at all." -- Thumper (1942)
> ------------------------------------------------------------------------
>
> _______________________________________________
> screen-devel mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/screen-devel
>   

-- 
Dr. Zvi Har'El      mailto:[email protected]    Department of Mathematics
tel:+972-54-4227607                  Technion - Israel Institute of Technology
fax:+972-4-8293388  http://www.math.technion.ac.il/~rl/    Haifa 32000, ISRAEL
"If you can't say somethin' nice, don't say nothin' at all." -- Thumper (1942)