Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] zformat -f has no multibyte support
- X-seq: zsh-workers 45143
- From: dana <dana@xxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Subject: Re: [BUG] zformat -f has no multibyte support
- Date: Wed, 25 Dec 2019 22:35:05 -0600
- Cc: zsh-workers@xxxxxxx
- In-reply-to: <20191224202327.or5yuftjieyq5z2o@tarpaulin.shahaf.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20191223222436.rtsmhs4xuug2jfum@localhost> <20191224202327.or5yuftjieyq5z2o@tarpaulin.shahaf.local2>
On 24 Dec 2019, at 14:23, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> Actually, I don't suppose we could just call into the printf code directly, can
> we? It _works_ (see attachment), but it's not elegant.
A very quick before/after test shows that it reduces performance quite a bit,
especially as the number of format specs increases. Admittedly, it's only a
few µs per spec in absolute numbers (at least on my Mac, with the handful of
operations i tested), and i don't know how that would compare with a
'lower-level' approach. I assume that multi-byte support will incur *some*
penalty no matter how it's done, so maybe it's reasonable, idk.
The only other thing i'd worry about is the user having to micro-manage REPLY,
but it looks like the way you've done it avoids any issues with that.
dana
Messages sorted by:
Reverse Date,
Date,
Thread,
Author