zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@ifh.de>
To: Uli Zappe <uli@tallowcross.uni-frankfurt.de>,
	zsh-workers@math.gatech.edu (Zsh hackers list)
Subject: Re: FAQ, German Umlauts (patch)
Date: Thu, 26 Jun 1997 18:46:02 +0200	[thread overview]
Message-ID: <199706261646.SAA20747@sgi.ifh.de> (raw)
In-Reply-To: "Uli Zappe"'s message of "Thu, 26 Jun 1997 17:43:17 MET." <9706261543.AA03628@tallowcross.uni-frankfurt.de>

Uli Zappe wrote:
> > Zsh doesn't even decide; the system does and it seems to be
> > getting it wrong.
> 
> But zsh is the *only* program with this problem on NEXTSTEP; so it  
> can't be as simple as "zsh is right, but NEXTSTEP is wrong"... :-(  
> perl, for instance, works perfectly well.

That's because they're simply not deciding.  Zsh, having a fairly
sophisticated editor, is trying to spare the user unreadable
characters on the terminal.  Perl doesn't know about characters, it
simply deals with byte streams.  You can probably see what I mean if
you have `less' and try to view something with non-ASCII characters.

> > The old zsh, so far as I remember, didn't even have the locale
> > mechanism, so is unlikely to be able to do non-ASCII characters.
> > Even a reasonable attempt at 8-bit characters is fairly new.
> 
> zsh 2.51 *can* deal perfectly with lower case Umlauts, as I said before.

That must be because it simply passed all 8-bit characters through.
This is unfortunately not a sensible default:  it'll screw up your old
VT100 something rotten, for example.

> > To clarify, zsh doesn't need the locale system
> > either, it just supports it if it is available.
> 
> Does this locale system consist of only the file /usr/lib/locale  
> (so that I simply could install such a file), or is there a  
> corresponding program that's necessary?

No, there's a whole mess of stuff in the operating system; either it
comes with it or it doesn't.

> > The alternative is Wolfgang Hukriede's suggestion of passing
> > through all characters.  That's dangerous in general, so it would
> > have to be an option.
> 
> Maybe it's not necessary to really pass thru *all* characters; I  
> can't judge, though.
> 
> Anyway, what do I have to do to make this option being implemented  
> in future versions of zsh?

It's very simple and I've just done it.  I've assumed that only eight
bit characters are a problem.  The option is called PRINT_EIGHT_BIT
(or printeightbit etc.); see the manual entry.  (Would PASS_EIGHT_BIT
be better? It sounded a little opaque to me.)

*** Doc/Zsh/options.yo.p8	Wed Apr 30 09:18:38 1997
--- Doc/Zsh/options.yo	Thu Jun 26 18:33:51 1997
***************
*** 622,627 ****
--- 622,634 ----
  tt(trap) and
  tt(unset).
  )
+ pindex(PRINT_EIGHT_BIT)
+ cindex(exit status, printing)
+ item(tt(PRINT_EIGHT_BIT) (tt(-1)))(
+ Print eight bit characters literally in completion lists, etc.
+ This option is not necessary if your system correctly returns the
+ printability of eight bit characters (see manref(ctype)(3)).
+ )
  pindex(PRINT_EXIT_VALUE)
  cindex(exit status, printing)
  item(tt(PRINT_EXIT_VALUE) (tt(-1)))(
*** Src/options.c.p8	Thu Jun 26 18:17:28 1997
--- Src/options.c	Thu Jun 26 18:14:26 1997
***************
*** 144,149 ****
--- 144,150 ----
  {NULL, "overstrike",	      0,			 OVERSTRIKE},
  {NULL, "pathdirs",	      0,			 PATHDIRS},
  {NULL, "posixbuiltins",	      OPT_EMULATE|OPT_BOURNE,	 POSIXBUILTINS},
+ {NULL, "printeightbit",       0,                         PRINTEIGHTBIT},
  {NULL, "printexitvalue",      0,			 PRINTEXITVALUE},
  {NULL, "privileged",	      OPT_SPECIAL,		 PRIVILEGED},
  {NULL, "promptcr",	      OPT_ALL,			 PROMPTCR},
*** Src/utils.c.p8	Thu Jun 26 18:17:18 1997
--- Src/utils.c	Thu Jun 26 18:39:11 1997
***************
*** 175,180 ****
--- 175,182 ----
      if (isprint(c))
  	goto done;
      if (c & 0x80) {
+ 	if (isset(PRINTEIGHTBIT))
+ 	    goto done;
  	*s++ = '\\';
  	*s++ = 'M';
  	*s++ = '-';
*** Src/zsh.h.p8	Tue Jun 24 09:09:11 1997
--- Src/zsh.h	Thu Jun 26 18:13:27 1997
***************
*** 1062,1068 ****
      VERBOSE,
      XTRACE,
      USEZLE,
!     OPT_SIZE
  };
  
  #undef isset
--- 1062,1069 ----
      VERBOSE,
      XTRACE,
      USEZLE,
!     OPT_SIZE,
!     PRINTEIGHTBIT
  };
  
  #undef isset

-- 
Peter Stephenson <pws@ifh.de>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77413
Deutsches Elektronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.


       reply	other threads:[~1997-06-26 16:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <9706261543.AA03628@tallowcross.uni-frankfurt.de>
1997-06-26 16:46 ` Peter Stephenson [this message]
1997-06-26 21:42   ` Zefram
1997-06-26 23:05     ` Uli Zappe
1997-06-27  1:25     ` Uli Zappe
1997-06-27  7:47     ` Peter Stephenson
1997-07-03  1:52     ` German Umlauts still don't work Uli Zappe
1997-07-03  4:01       ` Bart Schaefer
1997-07-03  4:48         ` Zoltan Hidvegi
1997-07-03 13:18         ` Uli Zappe
1997-06-27 19:06 FAQ, German Umlauts (patch) Amol Deshpande
1997-06-30  8:13 ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199706261646.SAA20747@sgi.ifh.de \
    --to=pws@ifh.de \
    --cc=uli@tallowcross.uni-frankfurt.de \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).