From owner-freebsd-questions@freebsd.org Sun Oct 18 17:23:15 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9BE63437985 for ; Sun, 18 Oct 2020 17:23:15 +0000 (UTC) (envelope-from 4250.82.1d4c50003ff0b0e.56e421c9d8dfc37b0bd5c5a082e6bb6b@email-od.com) Received: from s1-b0c6.socketlabs.email-od.com (s1-b0c6.socketlabs.email-od.com [142.0.176.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDmtp3J9yz4kDy for ; Sun, 18 Oct 2020 17:23:14 +0000 (UTC) (envelope-from 4250.82.1d4c50003ff0b0e.56e421c9d8dfc37b0bd5c5a082e6bb6b@email-od.com) DKIM-Signature: v=1; a=rsa-sha256; d=email-od.com;i=@email-od.com;s=dkim; c=relaxed/relaxed; q=dns/txt; t=1603041792; x=1605633792; h=content-transfer-encoding:content-type:mime-version:references:in-reply-to:message-id:subject:cc:to:from:date:x-thread-info; bh=dn6346QVEK0jbaBO19EVM+SbSTM8ge9p9WQBoZtgouM=; b=L4/w++D1oj4QraG7/bvh1ToD5SN9uIjBUFTNV8VUN16S95mW+PvJtjuBHNkWBDvaMWsPgoxaWmgBM5DzyWjAVi0UHtEOn3TK+dl0QIfBk2byzLM6FVdCn2BgFG7jbnTHwvIsfd5jW7Jr824p5frDWNUydmfoOp9nfwEjc132kbQ= X-Thread-Info: NDI1MC45Mi4xZDRjNTAwMDNmZjBiMGUuZnJlZWJzZC1xdWVzdGlvbnM9ZnJlZWJzZC5vcmc= Received: from r2.h.in.socketlabs.com (r2.h.in.socketlabs.com [142.0.180.12]) by mxsg2.email-od.com with ESMTP(version=Tls12 cipher=Aes256 bits=256); Sun, 18 Oct 2020 13:23:10 -0400 Received: from smtp.lan.sohara.org (EMTPY [185.202.17.215]) by r2.h.in.socketlabs.com with ESMTP(version=Tls12 cipher=Aes256 bits=256); Sun, 18 Oct 2020 13:23:11 -0400 Received: from [192.168.63.1] (helo=steve.lan.sohara.org) by smtp.lan.sohara.org with smtp (Exim 4.94 (FreeBSD)) (envelope-from ) id 1kUCOj-000G9T-Sp; Sun, 18 Oct 2020 18:23:10 +0100 Date: Sun, 18 Oct 2020 18:23:09 +0100 From: Steve O'Hara-Smith To: "John Levine" Cc: freebsd-questions@freebsd.org, naddy@mips.inka.de Subject: Re: printf(1) and UTF-8 multi-byte chars Message-Id: <20201018182309.490ff752536eae2092533c5a@sohara.org> In-Reply-To: <20201018154838.49CBC239CEDF@ary.qy> References: <20201018154838.49CBC239CEDF@ary.qy> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) X-Clacks-Overhead: "GNU Terry Pratchett" Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4CDmtp3J9yz4kDy X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=email-od.com header.s=dkim header.b=L4/w++D1; dmarc=none; spf=pass (mx1.freebsd.org: domain of 4250.82.1d4c50003ff0b0e.56e421c9d8dfc37b0bd5c5a082e6bb6b@email-od.com designates 142.0.176.198 as permitted sender) smtp.mailfrom=4250.82.1d4c50003ff0b0e.56e421c9d8dfc37b0bd5c5a082e6bb6b@email-od.com X-Spamd-Result: default: False [-2.92 / 15.00]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[email-od.com:s=dkim]; NEURAL_HAM_MEDIUM(-0.94)[-0.936]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:142.0.176.0/20]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[sohara.org]; NEURAL_HAM_LONG(-0.96)[-0.959]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[email-od.com:+]; NEURAL_HAM_SHORT(-1.32)[-1.320]; RCVD_IN_DNSWL_NONE(0.00)[142.0.176.198:from]; RWL_MAILSPIKE_GOOD(0.00)[142.0.176.198:from]; FORGED_SENDER(0.30)[steve@sohara.org,4250.82.1d4c50003ff0b0e.56e421c9d8dfc37b0bd5c5a082e6bb6b@email-od.com]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:7381, ipnet:142.0.176.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[steve@sohara.org,4250.82.1d4c50003ff0b0e.56e421c9d8dfc37b0bd5c5a082e6bb6b@email-od.com]; MAILMAN_DEST(0.00)[freebsd-questions] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 17:23:15 -0000 On 18 Oct 2020 11:48:37 -0400 "John Levine" wrote: > I don't think there is any useful middle ground between counting bytes > and full Unicode typesetting. There are good reasons for using all three levels, here are some: Bytes: Content length headers, malloc calls - storage related Glyphs: Truncation, apparent length, sorting - appearance related Unicode Characters: UTF-8/16/32 conversions - encoding related -- Steve O'Hara-Smith