Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: FAQ, German Umlauts (patch)



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@xxxxxx>       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.



Messages sorted by: Reverse Date, Date, Thread, Author