pkgsrc-Bugs archive

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

Re: pkg/45221: xterm utf-8 mode is (partially) a one-way trip



The following reply was made to PR pkg/45221; it has been noted by GNATS.

From: David Holland <dholland-pbugs%netbsd.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: pkg/45221: xterm utf-8 mode is (partially) a one-way trip
Date: Tue, 31 Jan 2023 22:26:13 +0000

 On Sun, Jul 18, 2021 at 10:05:01AM +0000, David Holland wrote:
  >  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.
 
 And it still happens, though the behavior might have changed a little.
 
 Open three xterms, starting them in non-utf-8 mode.
 
 In xterm 1, run
 	% echo foo | awk '{ printf "%c\n", 216 }'
 In xterm 2, switch to utf-8 mode with the right mouse menu
 ("UTF-8 Encoding") and run
 	% echo foo | awk '{ printf "%c%c\n", 195, 152 }'
 
 These should print the same glyph.
 
 Then in xterm 3:
 
 	% cat | hexdump -C
 	- select the glyph from xterm 1 (non-utf-8), paste
 	- it'll echo the correct glyph
 	- and you'll get "d8 0a" (the iso-latin-1 for the glyph
 	  and a newline)
 	- hit ^D
 	% cat | hexdump -C
 	- select the glyph from xterm 2 (utf-8), paste
 	- it'll echo the correct glyph
 	- and you'll get "d8 0a" (the iso-latin-1 for the glyph
 	  and a newline)
 	- hit ^D
 
 	- now switch this xterm to utf-8 mode with the right mouse menu
 	% cat | hexdump -C
 	- select the glyph from xterm 1 (non-utf-8), paste
 	- it'll echo the correct glyph
 	- and you'll get "c3 98 0a" (the utf-8 for the glyph
 	  and a newline)
 	- hit ^D
 	% cat | hexdump -C
 	- select the glyph from xterm 2 (utf-8), paste
 	- it'll echo the correct glyph
 	- and you'll get "c3 98 0a" (the utf-8 for the glyph
 	  and a newline)
 	- hit ^D
 
 	- now switch this xterm back out of utf-8 mode
 	% cat | hexdump -C
 	- select the glyph from xterm 1 (non-utf-8), paste
 	- it'll echo some other glyph
 	- and you'll get "c3 0a" (the wrong iso-latin-1
 	  and a newline)
 	- hit ^D
 	% cat | hexdump -C
 	- select the glyph from xterm 2 (utf-8), paste
 	- it'll echo the correct glyph
 	- and you'll get "c3 0a" (the wrong iso-latin-1
 	  and a newline)
 	- hit ^D
 
 	- if you switch back to utf-8 mode it'll paste correctly again
 
 Additional weirdness happens if you try to paste from the same xterm,
 which is possibly a different bug.
 
 	% xterm -version
 	XTerm(370)
 
 I'm going to change the PR from pkgsrc to xsrc since it is happening
 there and we possibly care more that way.
 
 -- 
 David A. Holland
 dholland%netbsd.org@localhost
 


Home | Main Index | Thread Index | Old Index