[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1124802: xterm: Cannot switch to UTF-8 Encoding without resetting the terminal



On Tue Jan  6 20:12:23 2026, dickey@invisible-island.net wrote:
> On Tue, Jan 06, 2026 at 07:10:35PM +0100, Jorgen Grahn wrote:
> > Package: xterm
> > Version: 398-1
> > Severity: normal
> > Tags: l10n
> > 
> > Dear Maintainer,
> > 
> > I upgraded to Debian 13 the other day, and afterwards, switching
> > to/from UTF-8 text in xterm behaves differently.
...

> > I should probably also disclose that I do my daily terminal work in
> > sv_SE, i.e. a non-utf8 locale. I have 35 years' worth of iso8859-1
> > data which I don't fancy converting. I only switch to a UTF-8 locale
> > when I ssh to the host where I read my mail. I open a new xterm
> > dedicated to this, use the xterm menu to select "UTF-8 Encoding" and
> > "UTF-8 Fonts", and then:
> > 
> >   % LANG=sv_SE.UTF-8 LC_CTYPE=sv_SE.UTF-8 ssh -t aphanes mutt
> > 
> > Aphanes runs OpenBSD, thus the odd locale names.

That last part was nonsense; sorry. I remember locale names were
different in OpenBSD at some point, but they're not now, and there's
nothing odd about these.

> > Anyway this should
> > not be relevant to my problem -- unless you feel starting a non-UTF-8
> > xterm is unsupported.
> 
> In a quick check (since I have lots of versions compiled...) I see the
> change in #390 (almost two years ago).  There's nothing specific to this
> feature in that change, but side-effects happen.  Digging a little further
> I see that change in xterm-389h, which deals with UPSS.  I see a few
> obscure possible (nothing definite), but with the clue from your report
> that a "reset" makes it workable, I can probably extend the chunk that
> does the switching to fill in whatever's needed.
> 
> As a workaround, this works for me:
> 
> 	tput rs2
> 
> and doesn't clear the screen.  I adapted one of my test-scripts to do this
> along with the UTF-8 switching (see attached).
...

Thanks for investigating! I should add that I have now opted for
another workaround: I simply have a window manager menu option which
starts an xterm in an UTF-8 locale, and I'll use that one for e.g.
reading my mail. I don't really have a use case for toggling in a
specific terminal.

But the xterm people might want to know there's an issue with
toggling. Unless you're one of them, in which case they already know. :-)

/Jorgen

-- 
  // Jörgen Grahn                  | mot du jour: trotjänaravlivning  
\X/ <grahn@snipabacken.se>         |                                  


Reply to: