Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: printf %s in UTF-8 is not POSIX-compliant
- X-seq: zsh-workers 24677
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: printf %s in UTF-8 is not POSIX-compliant
- Date: Tue, 4 Mar 2008 02:37:17 +0100
- In-reply-to: <20080304012917.GA15833@xxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20080304012917.GA15833@xxxxxxxxxxxxxxxxxxx>
I mixed up the field width and the precision, but there's the same
problem:
vin% emulate sh
vin% printf ".%.2s.\n" éabc
.éa.
vin% /usr/bin/printf ".%.2s.\n" éabc
.é.
vin%
and POSIX says:
field width
An optional string of decimal digits to specify a minimum field
width. For an output field, if the converted value has fewer
bytes than the field width, [...]
^^^^^
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author