My apologies if this is (partially ?) off-topic for this list.

I was trying to sort out UTF-8 support for the mail client "alpine", using the test page http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt
(very nice). I have copied this to a local file, which I just "cat".

I was redirected also to the equally nice documentation page
http://www.cl.cam.ac.uk/~mgk25/unicode.html#xterm

While the answer for my case is clear (I run alpine in an rxvt which I start from .fvwm2rc and rxvt has NO UTF-8 support, so I'll have to sort that out otherwise), I am puzzled by the xterm behaviour.

I use various xterms, both for local and remote use, and both started from a fvwm menu or from the shell, and I'm experiencing controversial behaviour.

For all tests, environment: fvwm 2.5.10 under Suse 9.2


A) local xterm started from menu via a plain Exec xterm

   this invokes a very simple resource file ~/XTerm (attached)
   the resulting shell has NO LC_CTYPE variable set
   the resulting xterm has UTF mode on though dimmed (control-MB3)
   UTF support works perfectly (well, with default font it does not
   display Amharic text, who cares, but with "Unicode best" it does)


B) remote xterm with ssh session
   started from menu via
    Exec xterm -class XTermLin -e ssh u...@host
   (actually I have several entries for different users and hosts,
   the host can be really remote or even my own local machine)

   the resulting shell has LC_CTYPE variable set for user root
   the resulting xterm has UTF mode on though dimmed (control-MB3)
   UTF support works perfectly (the only difference with the
   previous case is that the font names are different, "Unicode best"
   is just called "font1")

   The resource file XTermLin is attached


C) ssh xterm started from shell via an alias "lin host user"
   the alias lin is
    xterm -class XTermLin -T !:2...@!:1 -n !:2...@!:1 -e ssh !:2...@!:1 &

   so this uses the same resource file as B.

   however this does not work : the UTF test file comes out as complete
   garbage

   LC_CTYPE may be set (for user root) or not set (for me) but this
   has no effect. I ssh'ed on the local machine.

   xterm comes out with UTF mode OFF (control-MB3), but even if enabled it
   does not work. Just comes out as a different type of garbage.

   The primary purpose of the XTermLin resource file (and a family of
   others) is nowadays to use a different background and foreground so
   I can immediately tell that gold-on-black windows are remote while
   black-on-beige are local. There is also some explicit font setting
   but these fonts should be UTF-8 compliant (iso10646-1), In fact I
   copied them from the system /usr/X11R6/lib/X11/app-defaults/XTerm

   These files are mostly historical (now all our systems are Linux,
   but before we had Suns and DECstations, and I had separate resource
   files with different backgrounds and some other adjustments. One of
   the historical files has a note before the font section "one has to
   tell something more to make it a vt100"


D) local xterm started manually from the shell
   So presumably uses resource file XTerm as (A)

   LC_CTYPEis not set
   xterm comes out with UTF mode OFF (control-MB3)

   behaves exactly as (C) i.e. does not work

So apparently what happens is that when the xterm is started from a fvwm menu (A,B) UTF-8 support works. When it is started from the shell (C,D) it does NOT work even if one is using the SAME X resources.

E) further test
   local xterm started manually from the shell  as  xterm -u8

   this one comes out as UTF mode ON dimmed
   and works perfectly as (A)

So it looks like that fvwm is somehow appending a switch -u8 IMPLICITLY ?


.fvwm2rc contains some lines (inherited by the default Suse one) which
make reference to StringEncoding=UTF-8:xft:sans-serif:encoding=iso10646-1:size=10; followed by some font specification, but these seem not relevant to applications like xterm.

Can someone enlighten me ?

--
Lucio Chiappetti - INAF/IASF - via Bassini 15 - I-20133 Milano (Italy)
For more info : http://www.iasf-milano.inaf.it/~lucio/personal.html
-----------------------------------------------------------------------
"Nature" on government cuts to research       http://snipurl.com/4erid
"Nature" e i tagli del governo alla ricerca   http://snipurl.com/4erko
!! resources commented as !? probably do not work
!! respurces commented as !NO! definitely should not be used
!! resources commented are reminder of how they can be set
!!
!! this is equivalent to -sp and sets the numeric keypad
*SunKeyboard: true
!! equivalent to -cr red : force cursor visible
*cursorColor: red
!! as -rightbar, move scrollbar to the *right* side :-)
*RightScrollBar: true
!! as -ls 200, increase scrolled lines
*SaveLines: 200
!! useful resources -bg -fg -title ...
! *background: white
!!
!! stuff tested and not found useful
!? *VT100*backarrowKey: true
!? *SunFunctionKeys: false
!? ScoFunctionKeys: false
!? *HpFunctionKeys: false
!? *DecTerminalId: 220
!NO!  *EightBitControl: true
!! standard as in my XTerm
!! ------------------------------------------------------------------
!! this is equivalent to -sp and sets the numeric keypad
*SunKeyboard: true
!! equivalent to -cr red : force cursor visible
*cursorColor: white
!! as -rightbar, move scrollbar to the *right* side :-)
*RightScrollBar: true
!! as -ls 200, increase scrolled lines
*SaveLines: 200
!!
!! specific here
!! ------------------------------------------------------------------
*background: #000000000000
*foreground: #ff00e0000000
!!
!! from standard /usr/X11R6/lib/X11/app-defaults/XTerm
!! ------------------------------------------------------------------
*VT100*font:            
-misc-fixed-medium-r-semicondensed-*-13-120-75-75-c-60-iso10646-1
*VT100*wideFont:        
-misc-fixed-medium-r-normal-*-13-120-75-75-c-120-iso10646-1
*VT100*font1:           
-misc-fixed-medium-r-normal-*-18-120-100-100-c-90-iso10646-1
*VT100*wideFont1:       
-misc-fixed-medium-r-normal-*-18-120-100-100-c-180-iso10646-1
*eightBitInput:                true
*eightBitOutput:       true
*scrollKey:            true
*multiScroll:      on
*jumpScroll:       on
*ScrollBar:        on
*Scrollbar*width:      16
*Scrollbar*height:     16
*Scrollbar*shadowWidth:    2
*Scrollbar*borderWidth:    3

Reply via email to