From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id b0cadf82 for ; Thu, 26 Dec 2019 04:34:11 +0000 (UTC) Received: (qmail 978 invoked by alias); 26 Dec 2019 04:34:04 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45143 Received: (qmail 8973 invoked by uid 1010); 26 Dec 2019 04:34:04 -0000 X-Qmail-Scanner-Diagnostics: from mail-yw1-f50.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25670. spamassassin: 3.4.2. Clear:RC:0(209.85.161.50):SA:0(-1.9/5.0):. Processed in 3.783879 secs); 26 Dec 2019 04:34:04 -0000 X-Envelope-From: dana@dana.is X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.161.50 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=WBP7O5mpwxctFIrr7WyU5vlxzCB65J8lp6SlgBqtwSs=; b=sjrmkgKvUzstFu713RMYUOn/0cFCUEAv7v2aio918ddNmWqUj3qtJaX/qsQz6IBF7F YGjytn44neap7dRz98S9CL1KzfV/a126PWC5/dVNc7KBloIf+yqJbOxBSQ1e/qdC9X8a S7BqO9qdR6AOTXlhaYHDdXyoQr10/JxycravQPjv9ew0B35PiqhOMDZSHKtL2XkLurZL iJCH7aUyusXdVevX4inb23P56U9HXTfdwS3auhfMp2tlvhj+w//I6B68yOU792B7spRR Cc++S4YR3os5TzsKzGxVoiL3oubHPSWegtYFwz7mrz7Rfxxf886tM5BiQGIspXi5Fqbo OU/Q== X-Gm-Message-State: APjAAAV7fyhEcLToyScjrAbhCnn01pr2VdhyY4XDs7yi7aF/NkBCPhjp heP1R72pmbrRz6uqxBZfhGBHypulXURO1w== X-Google-Smtp-Source: APXvYqyWtLsL0Qzt3oayLORki87xLdxikLBQpOmRFNPojcwx35XpyOsn7XctxGQLMOGlh35yHXYjcw== X-Received: by 2002:a81:1d4f:: with SMTP id d76mr32684838ywd.200.1577334806752; Wed, 25 Dec 2019 20:33:26 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: [BUG] zformat -f has no multibyte support From: dana In-Reply-To: <20191224202327.or5yuftjieyq5z2o@tarpaulin.shahaf.local2> Date: Wed, 25 Dec 2019 22:35:05 -0600 Cc: zsh-workers@zsh.org Content-Transfer-Encoding: quoted-printable Message-Id: <8CB7B64F-BFB9-49C9-ACDD-AA60D58873E2@dana.is> References: <20191223222436.rtsmhs4xuug2jfum@localhost> <20191224202327.or5yuftjieyq5z2o@tarpaulin.shahaf.local2> To: Daniel Shahaf X-Mailer: Apple Mail (2.3445.104.11) On 24 Dec 2019, at 14:23, Daniel Shahaf 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 =C2=B5s 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