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

Re: printf %s in UTF-8 is not POSIX-compliant



Vincent Lefevre wrote:
> On 2008-03-04 09:40:07 +0000, Peter Stephenson wrote:
> > That seems to me useless.
> 
> But that what's POSIX requires (and this hasn't changed in the latest
> draft). Also, there may be reasons (e.g. file formats with limited
> field sizes). So, zsh should follow the specification, at least when
> it emulates sh, since the user may write scripts based on it.

There may be something we can do, but at the moment it looks more
complicated than that.  Emulations are tied to the behaviour of
interactive shells, so although it's likely you do indeed want
bog-standard byte oriented behaviour if the intention is to run a script
as sh (POSIX mostly deals in the "portable character set", broadly ASCII
so other multibyte effects are irrelevant and best turned off), it's
much less clear that turning off MULTIBYTE for all forms of sh emulation
is useful.  In particular, "emulate sh" is the nearest we have to bash
emulation and bash users are likely to expect multibyte characters to
work naturally.

Is it time to introduce a separate "bash" emulation (meaning smart,
interactive shell not necessarily 100% POSIX compatible) and
document that "sh" emulation is aimed at POSIX compatibility?
"emulate bash" already works but is treated the same way as "emulate sh".

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



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