unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Text mode Emacs in multibyte terminal
@ 2005-11-16 21:14 Andreas Schwab
  2005-11-16 22:11 ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Schwab @ 2005-11-16 21:14 UTC (permalink / raw)


When running a text mode Emacs in a multibyte environment (eg. utf8 xterm
with LANG=de_DE.UTF-8), and visiting a binary file (like /bin/true) you
get a garbled screen. The problem is that all non-control characters are
written verbatim to the terminal as if it were single-byte encoded.  Even
setting the buffer to multibyte and the terminal coding system to utf-8
doesn't help.  The only way to get a correct display is to load the file
with a forced coding system of utf-8 or some single-byte coding system.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Text mode Emacs in multibyte terminal
  2005-11-16 21:14 Text mode Emacs in multibyte terminal Andreas Schwab
@ 2005-11-16 22:11 ` Stefan Monnier
  2005-11-17  0:54   ` Andreas Schwab
  2005-12-07  7:41   ` Kenichi Handa
  0 siblings, 2 replies; 8+ messages in thread
From: Stefan Monnier @ 2005-11-16 22:11 UTC (permalink / raw)
  Cc: emacs-devel

> The problem is that all non-control characters are
> written verbatim to the terminal as if it were single-byte encoded.

You mean all the eight-bit-* chars?  I'd argue that such chars should always
be written as \NNN except for the special legacy case of unibyte sessions.


        Stefan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Text mode Emacs in multibyte terminal
  2005-11-16 22:11 ` Stefan Monnier
@ 2005-11-17  0:54   ` Andreas Schwab
  2005-12-07  7:41   ` Kenichi Handa
  1 sibling, 0 replies; 8+ messages in thread
From: Andreas Schwab @ 2005-11-17  0:54 UTC (permalink / raw)
  Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> The problem is that all non-control characters are
>> written verbatim to the terminal as if it were single-byte encoded.
>
> You mean all the eight-bit-* chars?

Only eight-bit-graphic.

> I'd argue that such chars should always be written as \NNN except for
> the special legacy case of unibyte sessions.

Looking closer the problem is the standard-display-table.  It is set up to
display all characters codes 0xa1-0xff as itself.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Text mode Emacs in multibyte terminal
  2005-11-16 22:11 ` Stefan Monnier
  2005-11-17  0:54   ` Andreas Schwab
@ 2005-12-07  7:41   ` Kenichi Handa
  2005-12-07 12:53     ` Stefan Monnier
  2005-12-08 19:29     ` Richard M. Stallman
  1 sibling, 2 replies; 8+ messages in thread
From: Kenichi Handa @ 2005-12-07  7:41 UTC (permalink / raw)
  Cc: schwab, emacs-devel

Sorry for the late response.

In article <87d5l0gs9n.fsf-monnier+emacs@gnu.org>, Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>  The problem is that all non-control characters are
>>  written verbatim to the terminal as if it were single-byte encoded.

> You mean all the eight-bit-* chars?  I'd argue that such chars should always
> be written as \NNN except for the special legacy case of unibyte sessions.

This was the case that a binary file is read into a unibyte
buffer, and \240..\377 are displayed as is; i.e. those exact
bytes are sent to the terminal.  That's happened because
Emacs setup standard-display-table for Latin-1 even if the
locale is UTF-8.  I'v just installed a fix not to setup
standard-display-table in such a case.

But, it seems that you are proposing not to setup
standard-display-table even if the locale is Latin-1, right?

---
Kenichi Handa
handa@m17n.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Text mode Emacs in multibyte terminal
  2005-12-07  7:41   ` Kenichi Handa
@ 2005-12-07 12:53     ` Stefan Monnier
  2005-12-07 13:02       ` Kenichi Handa
  2005-12-08 19:29     ` Richard M. Stallman
  1 sibling, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2005-12-07 12:53 UTC (permalink / raw)
  Cc: schwab, emacs-devel

>>> The problem is that all non-control characters are
>>> written verbatim to the terminal as if it were single-byte encoded.

>> You mean all the eight-bit-* chars?  I'd argue that such chars should always
>> be written as \NNN except for the special legacy case of unibyte sessions.

> This was the case that a binary file is read into a unibyte
> buffer, and \240..\377 are displayed as is; i.e. those exact
> bytes are sent to the terminal.  That's happened because
> Emacs setup standard-display-table for Latin-1 even if the
> locale is UTF-8.  I'v just installed a fix not to setup
> standard-display-table in such a case.

> But, it seems that you are proposing not to setup
> standard-display-table even if the locale is Latin-1, right?

Yes, that's indeed what I'm proposing.


        Stefan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Text mode Emacs in multibyte terminal
  2005-12-07 12:53     ` Stefan Monnier
@ 2005-12-07 13:02       ` Kenichi Handa
  2005-12-07 14:47         ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Kenichi Handa @ 2005-12-07 13:02 UTC (permalink / raw)
  Cc: schwab, emacs-devel

In article <87vey13w7y.fsf-monnier+emacs@gnu.org>, Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>  But, it seems that you are proposing not to setup
>>  standard-display-table even if the locale is Latin-1, right?

> Yes, that's indeed what I'm proposing.

As I'm not a Latin-X user, I'm not sure about it, but I've
thought that a Latin-1 user expects to see \240..\377 of a
unibyte buffer (for instance the case of visiting a binary
file) by Latin-1 characters.  If that's not true anymore, I
agree with such a change, but of course, after the release.

---
Kenichi Handa
handa@m17n.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Text mode Emacs in multibyte terminal
  2005-12-07 13:02       ` Kenichi Handa
@ 2005-12-07 14:47         ` Stefan Monnier
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2005-12-07 14:47 UTC (permalink / raw)
  Cc: schwab, emacs-devel

>>> But, it seems that you are proposing not to setup
>>> standard-display-table even if the locale is Latin-1, right?
>> Yes, that's indeed what I'm proposing.
> As I'm not a Latin-X user, I'm not sure about it, but I've
> thought that a Latin-1 user expects to see \240..\377 of a
> unibyte buffer (for instance the case of visiting a binary
> file) by Latin-1 characters.  If that's not true anymore, I
> agree with such a change, but of course, after the release.

It's never been true for me.  When visiting a binary file, I don't expect
to see much of anything, really, other than hopefully some recognizable
ASCII somewhere.

But I don't claim to be representative of all latin-1 users.


        Stefan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Text mode Emacs in multibyte terminal
  2005-12-07  7:41   ` Kenichi Handa
  2005-12-07 12:53     ` Stefan Monnier
@ 2005-12-08 19:29     ` Richard M. Stallman
  1 sibling, 0 replies; 8+ messages in thread
From: Richard M. Stallman @ 2005-12-08 19:29 UTC (permalink / raw)
  Cc: schwab, monnier, emacs-devel

    But, it seems that you are proposing not to setup
    standard-display-table even if the locale is Latin-1, right?

This is not a bug fix, it is a proposal to change the features.
Now is not the time to consider such a change, so please
let's drop the idea.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-12-08 19:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-16 21:14 Text mode Emacs in multibyte terminal Andreas Schwab
2005-11-16 22:11 ` Stefan Monnier
2005-11-17  0:54   ` Andreas Schwab
2005-12-07  7:41   ` Kenichi Handa
2005-12-07 12:53     ` Stefan Monnier
2005-12-07 13:02       ` Kenichi Handa
2005-12-07 14:47         ` Stefan Monnier
2005-12-08 19:29     ` Richard M. Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).