GNU bug report logs - #17909
24.4.50; #'read-char fails with non-ASCII characters on the TTY

Previous Next

Package: emacs;

Reported by: Aidan Kehoe <kehoea <at> parhasard.net>

Date: Thu, 3 Jul 2014 14:54:02 UTC

Severity: normal

Tags: notabug

Found in version 24.4.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17909 in the body.
You can then email your comments to 17909 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#17909; Package emacs. (Thu, 03 Jul 2014 14:54:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Aidan Kehoe <kehoea <at> parhasard.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 03 Jul 2014 14:54:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Aidan Kehoe <kehoea <at> parhasard.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4.50; #'read-char fails with non-ASCII characters on the TTY
Date: Thu, 3 Jul 2014 15:52:29 +0100
Hello --

Starting from the shell:

$ cd /Sources/emacs/src
$ ./emacs -nw -Q RET

Then, within *scratch*, I type ƒ or ä, both of which are available on my OS
keyboard layout, and both of which self-insert without problems in the same
GNU Emacs. I then type:

(string (read-char)) <control-j> ä

This gives:

"Ã"

I note that the first octet of the UTF-8 encoding of ä corresponds to
this, as we see with, e.g.:

(decode-coding-string (encode-coding-string "ä" 'utf-8) 'iso-8859-1)
=> "ä"

This bug means, among other things, that I can't name a register ä on
the TTY. The same recipe works correctly when the same binary is started as
a Cocoa app, e.g. with open /Sources/emacs/nextstep/Emacs.app .

Best,

Aidan

In GNU Emacs 24.4.50.1 (i386-apple-darwin10.8.0, NS appkit-1038.36 Version 10.6.8 (Build 10K549))
 of 2014-07-03 on bonbon
Configured using:
 `configure --with-ns'

Configured features:
RSVG IMAGEMAGICK DBUS ACL GNUTLS LIBXML2 ZLIB

Important settings:
  value of $LANG: de_DE.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t

Recent input:
ESC [ ? 1 ; 2 c ESC x r e p o r t - e m a c s - b u 
g RET

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message dired format-spec
rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util help-fns mail-prsvr mail-utils xterm time-date
tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
ns-win tool-bar dnd fontset image regexp-opt fringe tabulated-list
newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp
files text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind cocoa ns multi-tty emacs)

Memory information:
((conses 8 81518 6143)
 (symbols 24 17883 0)
 (miscs 20 32 176)
 (strings 16 11312 3556)
 (string-bytes 1 289486)
 (vectors 8 7574)
 (vector-slots 4 346198 1936)
 (floats 8 64 283)
 (intervals 28 258 201)
 (buffers 512 12))

-- 
‘Liston operated so fast that he once accidentally amputated an assistant’s 
fingers along with a patient’s leg, […] The patient and the assistant both 
died of sepsis, and a spectator reportedly died of shock, resulting in the 
only known procedure with a 300% mortality.’ (Atul Gawande, NEJM, 2012)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17909; Package emacs. (Thu, 03 Jul 2014 15:43:01 GMT) Full text and rfc822 format available.

Message #8 received at 17909 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> suse.de>
To: Aidan Kehoe <kehoea <at> parhasard.net>
Cc: 17909 <at> debbugs.gnu.org
Subject: Re: bug#17909: 24.4.50;
 #'read-char fails with non-ASCII characters on the TTY
Date: Thu, 03 Jul 2014 17:42:29 +0200
From NEWS:

* Incompatible Lisp Changes in Emacs 24.4

** `read-event' does not return decoded chars in ttys any more.
As was the case in Emacs 22 and before, the decoding of terminal
input, according to `keyboard-coding-system', is not performed in
`read-event' any more.  But unlike in Emacs 22, this decoding is still
done before `input-decode-map', `function-key-map', etc.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab <at> suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."




Added tag(s) notabug. Request was from Stefan Monnier <monnier <at> iro.umontreal.ca> to control <at> debbugs.gnu.org. (Thu, 03 Jul 2014 16:31:01 GMT) Full text and rfc822 format available.

Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Thu, 03 Jul 2014 16:31:02 GMT) Full text and rfc822 format available.

Notification sent to Aidan Kehoe <kehoea <at> parhasard.net>:
bug acknowledged by developer. (Thu, 03 Jul 2014 16:31:03 GMT) Full text and rfc822 format available.

Message #15 received at 17909-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Andreas Schwab <schwab <at> suse.de>
Cc: Aidan Kehoe <kehoea <at> parhasard.net>, 17909-done <at> debbugs.gnu.org
Subject: Re: bug#17909: 24.4.50; #'read-char fails with non-ASCII characters on
 the TTY
Date: Thu, 03 Jul 2014 12:30:09 -0400
tags 17909 notabug
thanks

>> From NEWS:
> * Incompatible Lisp Changes in Emacs 24.4
> ** `read-event' does not return decoded chars in ttys any more.
> As was the case in Emacs 22 and before, the decoding of terminal
> input, according to `keyboard-coding-system', is not performed in
> `read-event' any more.  But unlike in Emacs 22, this decoding is still
> done before `input-decode-map', `function-key-map', etc.

Oops, indeed, the above text is incorrect.  Whether the decoding is done
or not depends on the value of the `inherit-input-method' argument.
IOW, use (read-char nil t).  Note that in many cases, `read-key' is
a better choice than read-char.

I changed etc/NEWS accordingly.


        Stefan




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 01 Aug 2014 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 327 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.