Menu

#48 UTF-8 in terminal titles

open
UI (9)
5
2012-05-12
2012-05-12
No

'echo -en "\e]0;ƕ\007" ; sleep 2' shows an 'AE' character and a '?' as title instead

Discussion

1 2 > >> (Page 1 of 2)
  • Arnout Engelen

    Arnout Engelen - 2012-05-12

    More reliable:

    echo -en "\e]0;\xE2\x98\xA0\007" ; sleep 2

    (should show 'jolly roger', shows â? instead

     
  • Arnout Engelen

    Arnout Engelen - 2012-05-12

    This might be a problem with xterm(?): when I set WM_NAME manually using:

    echo -e "\xE2\x98\xA0" | xargs xprop -set WM_NAME

    it gets set correctly.

     
  • Arnout Engelen

    Arnout Engelen - 2012-05-12

    It seems this is an XTerm thing, not a Notion thing: XTerm sets the WM_NAME in Latin1 by default (as was required on old vt220 terminals).

    Adding this control sequence enables setting titles in UTF8 and seems to work for me:

    echo -ne '\e[>2;2t\e]0;\xe7\x85\x8e\xe8\x9b\x8b\007'; sleep 2

    I am very surprised that this works when the XFT patch is applied - are you sure about that?

     
  • realturner

    realturner - 2012-05-12

    I am not using Xterm, but Rxvt-unicode.
    But I just tested xterm and yes it displays just as that image I posted.

    To leave the terminal issue, maybe we should test in browser:
    1. Open google chrome, surf to http://jandan.net
    2. The glyph of first two full-width characters in title should be the same as the posted image

     
  • realturner

    realturner - 2012-05-12

    Sorry for previous misunderstanding, you mentioned that you just works fine without XFT? This surprising me, too. Just aware I've been working on patching problem because of missing something :(

     
  • Arnout Engelen

    Arnout Engelen - 2012-05-12

    Let's keep this issue for UTF8 issues in terminals. This works in rxvt too, right?

    Both firefox and chrome seems to display that page title correctly for me. Can you create a seperate issue to find out what's going on if it doesn't work for you?

     
  • Arnout Engelen

    Arnout Engelen - 2012-05-12
    • summary: Utf8 in titles --> UTF-8 in terminal titles
    • status: open --> pending
     
  • realturner

    realturner - 2012-05-12

    No it doesn't works neither in Xterm or rxvt in my case.
    But since you said you displayed properly, I guess it is because of my incorrect configuration.
    I'll open another issue to discuss.

     
  • Arnout Engelen

    Arnout Engelen - 2012-05-12

    What is your locale?

     
  • Arnout Engelen

    Arnout Engelen - 2012-05-12
    • status: pending --> open
     
  • realturner

    realturner - 2012-05-12

    Here is my output from `locale':

    LANG=en_US.UTF-8
    LC_CTYPE=zh_TW.UTF-8
    LC_NUMERIC="en_US.UTF-8"
    LC_TIME="en_US.UTF-8"
    LC_COLLATE="en_US.UTF-8"
    LC_MONETARY="en_US.UTF-8"
    LC_MESSAGES="en_US.UTF-8"
    LC_PAPER="en_US.UTF-8"
    LC_NAME="en_US.UTF-8"
    LC_ADDRESS="en_US.UTF-8"
    LC_TELEPHONE="en_US.UTF-8"
    LC_MEASUREMENT="en_US.UTF-8"
    LC_IDENTIFICATION="en_US.UTF-8"
    LC_ALL=

     
  • Arnout Engelen

    Arnout Engelen - 2012-05-12

    Does the following correctly set the title?

    echo -e "\xe7\x85\x8e\xe8\x9b\x8b\007" | xargs xprop -id `xdotool getwindowfocus` -set WM_NAME ; sleep 2

     
  • Arnout Engelen

    Arnout Engelen - 2012-05-12

    Does it matter whether you have CF_DE_USE_XUTF8 enabled? (I never enable this myself)

     
  • realturner

    realturner - 2012-05-12

    I tried both using CF_DE_USE_XUTF8 or not, but both failed to display properly.
    I am using Archlinux, and the building procedure only modifies PREFIX, ETCDIR, LUA_DIR, and X11_PREFIX

     
  • Arnout Engelen

    Arnout Engelen - 2012-05-12

    OK, both fail to display the following:

    echo -e "\xe7\x85\x8e\xe8\x9b\x8b\007" | xargs xprop -id `xdotool getwindowfocus` -set WM_NAME ; sleep 2

    What does happen? Does anything happen at all?

     
  • realturner

    realturner - 2012-05-12

    It displays unexpected characters in the title, as the image:
    http://w.csie.org/~r99922046/file/jandan1.png
    no matter of CF_DE_USE_XUTF8 optoin

     
  • Arnout Engelen

    Arnout Engelen - 2012-05-12

    Interesting. What does 'echo -e "\xe7\x85\x8e\xe8\x9b\x8b\007" | xargs xprop -id `xdotool getwindowfocus` -set WM_NAME ; xprop -id `xdotool getwindowfocus` | grep WM_NAME' show?

     
  • realturner

    realturner - 2012-05-12

    result is here: http://w.csie.org/~r99922046/file/jandan2.png
    good in Xterm but not in title.
    The title font is:
    font = "-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*"

     
  • realturner

    realturner - 2012-05-12

    If that helps, I can prepare a VM reproducing this problem, but I might only be able to do this after several days.

     
  • Arnout Engelen

    Arnout Engelen - 2012-05-12

    It might be interesting to see which exact font the xserver chooses for that pattern, and how your text is rendered in that font. Is it possible to verify that? I tried xfontsel but it doesn't seem to support UTF-8 as sample text for normal fonts.

     
  • Arnout Engelen

    Arnout Engelen - 2012-05-12

    Shouldn't we be using 'iso10646' to ensure we're selecting an UTF-8-enabled font? Then it can be tested with:

    echo -e "\xe7\x85\x8e\xe8\x9b\x8b" | xargs xfontsel -pattern "-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-iso10646-*" -sampleUCS

     
  • Arnout Engelen

    Arnout Engelen - 2012-05-12

    hmm, i'm confused - selecting "-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-iso10646-*" in xfontsel show 'dotted squares', while when I put this into my theme it does seem to work.

     
  • Arnout Engelen

    Arnout Engelen - 2012-05-12

    I noticed the wenquanyi fonts are also available as x11 fonts (xfonts-wqy in Debian) - but when I try to select them in xfontsel it stops responding :/

     
1 2 > >> (Page 1 of 2)

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.