NetBSD Problem Report #45221

From dholland@macaran.localdomain  Sun Aug  7 05:38:40 2011
Return-Path: <dholland@macaran.localdomain>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 6EB9E63CB22
	for <gnats-bugs@gnats.NetBSD.org>; Sun,  7 Aug 2011 05:38:40 +0000 (UTC)
Message-Id: <20110807042127.5AF566E1D8@macaran.localdomain>
Date: Sun,  7 Aug 2011 00:21:27 -0400 (EDT)
From: dholland@eecs.harvard.edu
Reply-To: dholland@eecs.harvard.edu
To: gnats-bugs@gnats.NetBSD.org
Subject: xterm utf-8 mode is (partially) a one-way trip
X-Send-Pr-Version: 3.95

>Number:         45221
>Category:       pkg
>Synopsis:       xterm utf-8 mode is (partially) a one-way trip
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 07 05:40:00 +0000 2011
>Last-Modified:  Sun Jul 18 10:05:01 +0000 2021
>Originator:     David A. Holland
>Release:        NetBSD 5.99.49 (pkgsrc from 20110730)
>Organization:
>Environment:
System: NetBSD macaran 5.99.49 NetBSD 5.99.49 (MACARAN) #8: Mon Apr 11 19:54:18 EDT 2011 dholland@macaran:/usr/src/sys/arch/amd64/compile/MACARAN amd64
Architecture: x86_64
Machine: amd64
>Description:

xterm-259 from pkgsrc X has the following problem:

If you
  - start it in non-utf-8 mode
  - switch to utf-8 mode with the ctrl-rightmouse menu
  - do some stuff
  - switch back to normal mode with the ctrl-rightmouse menu

then only output handling and not input handling switches back away
from utf-8. That is, if you print characters 128-255 from programs,
they're displayed as the matching iso-latin-1 glyphs; but if you paste
characters 128-255 into the xterm they are converted to utf-8 on the
way in and programs read them as multibyte sequences. This conversion
is apparently enabled when utf-8 mode is switched on, but not disabled
again when it's switched off.


>How-To-Repeat:

prepare something suitable in your cut buffer, open a fresh xterm, and
paste into cat as follows:

	% cat | hexdump -C
	<correct glyph>
	00000000  d8 0a                                             |..|
	00000002

switch on utf-8 mode:

	% cat | hexdump -C
	<correct glyph>
	00000000  c3 98 0a                                          |...|
	00000003

switch off utf-8 mode:

	% cat | hexdump -C
	<wrong glyph>
	00000000  c3 98 0a                                          |...|
	00000003

>Fix:

	dunno, probably obvious if you know where to look, which I don't.

>Audit-Trail:
From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/45221: xterm utf-8 mode is (partially) a one-way trip
Date: Sun, 18 Jul 2021 10:02:34 +0000

 On Sun, Aug 07, 2011 at 05:40:00AM +0000, dholland@eecs.harvard.edu wrote:
  > If you
  >   - start it in non-utf-8 mode
  >   - switch to utf-8 mode with the ctrl-rightmouse menu
  >   - do some stuff
  >   - switch back to normal mode with the ctrl-rightmouse menu
  > 
  > then only output handling and not input handling switches back away
  > from utf-8.

 This still happens 10 years later with the xterm in base X, not sure
 if the one in pkgsrc is different but I doubt it.

 -- 
 David A. Holland
 dholland@netbsd.org

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.