From unknown Fri Jun 20 07:11:54 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#20258 <20258@debbugs.gnu.org> To: bug#20258 <20258@debbugs.gnu.org> Subject: Status: 24.5; format-time-string miscounting of multibyte characters Reply-To: bug#20258 <20258@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:11:54 +0000 retitle 20258 24.5; format-time-string miscounting of multibyte characters reassign 20258 emacs submitter 20258 Gunnar Horrigmo severity 20258 minor tag 20258 fixed patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 04 11:35:06 2015 Received: (at submit) by debbugs.gnu.org; 4 Apr 2015 15:35:06 +0000 Received: from localhost ([127.0.0.1]:44847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YeQ6D-0007DI-FJ for submit@debbugs.gnu.org; Sat, 04 Apr 2015 11:35:06 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41752) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YeP9E-0005k4-5S for submit@debbugs.gnu.org; Sat, 04 Apr 2015 10:34:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YeP97-0004Cn-9S for submit@debbugs.gnu.org; Sat, 04 Apr 2015 10:34:02 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:44462) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YeP97-0004Cj-73 for submit@debbugs.gnu.org; Sat, 04 Apr 2015 10:34:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YeP96-0005sV-10 for bug-gnu-emacs@gnu.org; Sat, 04 Apr 2015 10:34:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YeP90-0004CJ-SM for bug-gnu-emacs@gnu.org; Sat, 04 Apr 2015 10:33:58 -0400 Received: from mail-out4.uio.no ([129.240.10.15]:54696) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YeP90-0004C2-FR for bug-gnu-emacs@gnu.org; Sat, 04 Apr 2015 10:33:54 -0400 Received: from mail-mx1.uio.no ([129.240.10.29]) by mail-out4.uio.no with esmtp (Exim 4.80.1) (envelope-from ) id 1YeP8x-0000zT-Di for bug-gnu-emacs@gnu.org; Sat, 04 Apr 2015 16:33:51 +0200 Received: from lumpy-gravy.uio.no ([129.240.203.134]) by mail-mx1.uio.no with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.80) (envelope-from ) id 1YeP8w-0004Lr-NW for bug-gnu-emacs@gnu.org; Sat, 04 Apr 2015 16:33:51 +0200 From: Gunnar Horrigmo To: bug-gnu-emacs@gnu.org Subject: 24.5; format-time-string miscounting of multibyte characters Date: Sat, 04 Apr 2015 16:33:50 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-UiO-Ratelimit-Test: rcpts/h 1 msgs/h 1 sum rcpts/h 2 sum msgs/h 2 total rcpts 325 max rcpts/h 15 ratelimit 0 X-UiO-Spam-info: not spam, SpamAssassin (score=-5.0, required=5.0, autolearn=disabled, T_RP_MATCHES_RCVD=-0.01, UIO_MAIL_IS_INTERNAL=-5, uiobl=NO, uiouri=NO) X-UiO-Scanned: B463F1723C3B35D67698654ECB4D4EF1682C4B0B X-UiO-SPAM-Test: remote_host: 129.240.203.134 spam_score: -49 maxlevel 80 minaction 2 bait 0 mail/h: 1 total 318 max/h 6 blacklist 0 greylist 0 ratelimit 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 04 Apr 2015 11:35:03 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) As the subject says, format-time-string miscounts multibyte characters. Simple example with nb_NO.utf8 locale, where =C3=B8 is two bytes: (format-time-string "%6a" (date-to-time "Sat Apr 4 16:14:40 2015")) " l=C3=B8." (length (format-time-string "%6a" (date-to-time "Sat Apr 4 16:14:40 2015")= )) 5 Let me know if you need more info. --Gunnar In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.10) of 2015-04-01 on lumpy-gravy.uio.no Repository revision: 1b70aa634c9ce117fed418894b54b1f2647bda1c Windowing system distributor `StarNet Communications Corp.', version 11.0.1= 4000 System Description: Fedora release 21 (Twenty One) Important settings: value of $LC_MONETARY: nb_NO.utf8 value of $LC_NUMERIC: nb_NO.utf8 value of $LC_TIME: nb_NO.utf8 value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Help Minor modes in effect: tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t Recent messages: nnimap read 417k from secure.runbox.no nnimap read 466k from secure.runbox.no nnimap read 581k from secure.runbox.no nnimap read 655k from secure.runbox.no nnimap read 729k from secure.runbox.no Mark set Mark saved where search started [2 times] Making completion list... Quit [4 times] Type C-x 1 to delete the help window, C-M-v to scroll help. Quit [2 times] Load-path shadows: /uio/kant/usit-gdw-u1/horrigmo/emacs/locate hides /uio/kant/usit-gdw-u1/hor= rigmo/emacs/src/emacs-24/emacs/lisp/locate Features: (shadow nnir emacsbug reposition sort smiley gnus-cite mm-archive mail-extr gnus-bcklg eieio-opt speedbar sb-image ezimage dframe find-func gnus-async qp gnus-ml disp-table pp gnus-eform debug jka-compr misearch multi-isearch help-mode gnus-topic nndraft nnmh utf-7 gnutls nnimap utf7 parse-time netrc network-stream starttls tls gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 nntp gnus-cache gnus-sum gnus-group gnus-undo nnfolder nnoo nnmail mail-source avoid mm-view mml-smime smime dig mailcap gnus-start gnus-spec gnus-int gnus-range gnus-win gnus gnus-ems wid-edit nnheader rt-liberation edmacro kmacro browse-url markstack epa-file epa derived epg etags info smtpmail auth-source eieio byte-opt bytecomp byte-compile cl-extra cconv eieio-core gnus-util password-cache sendmail message cl-macs format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mailabbrev mail-utils gmm-utils mailheader ange-ftp comint ansi-color ring cl gv cl-loaddefs cl-lib package epg-config time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 16 278530 45717) (symbols 48 32240 0) (miscs 40 185 563) (strings 32 55977 9185) (string-bytes 1 1975855) (vectors 16 32030) (vector-slots 8 1345064 168271) (floats 8 255 726) (intervals 56 14581 139) (buffers 960 37) (heap 1024 54088 6705)) --=20 Gunnar From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 04 11:42:21 2015 Received: (at 20258) by debbugs.gnu.org; 4 Apr 2015 15:42:21 +0000 Received: from localhost ([127.0.0.1]:44852 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YeQDF-0007OE-9a for submit@debbugs.gnu.org; Sat, 04 Apr 2015 11:42:21 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:34460) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YeQDD-0007O0-FX for 20258@debbugs.gnu.org; Sat, 04 Apr 2015 11:42:20 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NMA00700GHMQK00@a-mtaout22.012.net.il> for 20258@debbugs.gnu.org; Sat, 04 Apr 2015 18:42:13 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NMA007GXGYCIOA0@a-mtaout22.012.net.il>; Sat, 04 Apr 2015 18:42:13 +0300 (IDT) Date: Sat, 04 Apr 2015 18:42:13 +0300 From: Eli Zaretskii Subject: Re: bug#20258: 24.5; format-time-string miscounting of multibyte characters In-reply-to: X-012-Sender: halo1@inter.net.il To: Gunnar Horrigmo Message-id: <83r3rzoq7e.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 8BIT References: X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 20258 Cc: 20258@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Gunnar Horrigmo > Date: Sat, 04 Apr 2015 16:33:50 +0200 > > > As the subject says, format-time-string miscounts multibyte characters. > Simple example with nb_NO.utf8 locale, where ø is two bytes: > > (format-time-string "%6a" (date-to-time "Sat Apr 4 16:14:40 2015")) > " lø." > > (length (format-time-string "%6a" (date-to-time "Sat Apr 4 16:14:40 2015"))) > 5 'length' counts characters, not bytes. If you need to count bytes, use 'string-bytes' instead: (string-bytes " lø.") => 6 From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 04 12:03:56 2015 Received: (at 20258) by debbugs.gnu.org; 4 Apr 2015 16:03:56 +0000 Received: from localhost ([127.0.0.1]:44864 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YeQY7-0007u6-Qg for submit@debbugs.gnu.org; Sat, 04 Apr 2015 12:03:56 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:13926) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YeQY5-0007tt-J3 for 20258@debbugs.gnu.org; Sat, 04 Apr 2015 12:03:54 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgUFAGvvdVRBbthL/2dsb2JhbAA3gVOhb4EIgXYBBVYjEAs0EhQYDSSqJIwMCwQEEQUICAIGAgICAw4JAwECgz4Dg3AEqDs X-IPAS-Result: AgUFAGvvdVRBbthL/2dsb2JhbAA3gVOhb4EIgXYBBVYjEAs0EhQYDSSqJIwMCwQEEQUICAIGAgICAw4JAwECgz4Dg3AEqDs X-IronPort-AV: E=Sophos;i="5.01,1,1400040000"; d="scan'208";a="115408833" Received: from 65-110-216-75.cpe.pppoe.ca (HELO pastel.home) ([65.110.216.75]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 04 Apr 2015 12:03:48 -0400 Received: by pastel.home (Postfix, from userid 20848) id 83B13A97; Sat, 4 Apr 2015 12:03:47 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#20258: 24.5; format-time-string miscounting of multibyte characters Message-ID: References: <83r3rzoq7e.fsf@gnu.org> Date: Sat, 04 Apr 2015 12:03:47 -0400 In-Reply-To: <83r3rzoq7e.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 04 Apr 2015 18:42:13 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 20258 Cc: 20258@debbugs.gnu.org, Gunnar Horrigmo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > 'length' counts characters, not bytes. If you need to count bytes, > use 'string-bytes' instead: > (string-bytes " l=F8.") =3D> 6 And in 99% of the cases, using length-bytes doesn't do what you think (it doesn't count the number of bytes that it would take in your favorite coding-system, but the number of bytes it takes within Emacs's internal encoding). If you want to know how many bytes it would take in your locale's encoding, then you need: (length (encode-coding-string locale-coding-system)) Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 04 12:42:34 2015 Received: (at 20258) by debbugs.gnu.org; 4 Apr 2015 16:42:34 +0000 Received: from localhost ([127.0.0.1]:44868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YeR9W-0000Ma-5j for submit@debbugs.gnu.org; Sat, 04 Apr 2015 12:42:34 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:34619) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YeR9T-0000MQ-Se for 20258@debbugs.gnu.org; Sat, 04 Apr 2015 12:42:32 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3lK3ny5Bgjz3hj9M; Sat, 4 Apr 2015 18:42:30 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3lK3ny3JsKzvh1q; Sat, 4 Apr 2015 18:42:30 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id G04d6MznHqfH; Sat, 4 Apr 2015 18:42:29 +0200 (CEST) X-Auth-Info: 5PrDLy/11pjxUlxb0I3idbVxXoi9PT7WDrxca310KYxp/Rc/5ERi4N0WjZEdxTn3 Received: from igel.home (ppp-212-114-183-4.dynamic.mnet-online.de [212.114.183.4]) by mail.mnet-online.de (Postfix) with ESMTPA; Sat, 4 Apr 2015 18:42:29 +0200 (CEST) Received: by igel.home (Postfix, from userid 1000) id 4A6AA2C3A3A; Sat, 4 Apr 2015 18:42:29 +0200 (CEST) From: Andreas Schwab To: Gunnar Horrigmo Subject: Re: bug#20258: 24.5; format-time-string miscounting of multibyte characters References: X-Yow: Are we THERE yet?? Date: Sat, 04 Apr 2015 18:42:29 +0200 In-Reply-To: (Gunnar Horrigmo's message of "Sat, 04 Apr 2015 16:33:50 +0200") Message-ID: <87egnzj156.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 20258 Cc: 20258@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Gunnar Horrigmo writes: > As the subject says, format-time-string miscounts multibyte characters. > Simple example with nb_NO.utf8 locale, where ø is two bytes: > > (format-time-string "%6a" (date-to-time "Sat Apr 4 16:14:40 2015")) > " lø." This is a limitation of the underlying strftime, which operates on bytes, not characters. This could be fixed by using wcsftime instead. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 29 20:35:26 2019 Received: (at 20258-done) by debbugs.gnu.org; 30 Sep 2019 00:35:26 +0000 Received: from localhost ([127.0.0.1]:56236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEjew-00077v-DH for submit@debbugs.gnu.org; Sun, 29 Sep 2019 20:35:26 -0400 Received: from mail-pf1-f175.google.com ([209.85.210.175]:43055) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEjev-00077h-Bu for 20258-done@debbugs.gnu.org; Sun, 29 Sep 2019 20:35:25 -0400 Received: by mail-pf1-f175.google.com with SMTP id a2so4548566pfo.10 for <20258-done@debbugs.gnu.org>; Sun, 29 Sep 2019 17:35:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc :content-transfer-encoding; bh=1JIkjVxfB/WQ0iMvQDZlg+gPvDuw0LzDqPALnqjMi+k=; b=PMv17suIejsIxzzhOkHB52qPlJlCQGXOGd59TdUleqx8T2RwECjyBqJgfn7KJx4SZ4 CJTHScAsEG0MPn7NxEMlfIjbcccWKHJ0ZKMfIT6/tBhKOA5jDhnlLAF3h28YEIiOpeI6 MlewPxhZ6uiBIl1BrzrO/W/aGQyQ3JJIJ6bZFwRJOeOCHORlgGNNamhcvuE9Kq2daFyk RBy/fj7lyDhXBo54bcMgR+3LO4TZO08O1NEMQ54LgmD/MhfMDTDbjWoXxZGH74SWPhGz 4VvVxzHutjgs1f8n2Cxk+77XasbExXKh2WKaqixs40LHJeqngnu97WWQhbmaToPGIMQY cFYA== X-Gm-Message-State: APjAAAUI1I2xWLhbSoS3BMT8D10jwOC6G+7qsgSPCUvDxBVfR0eXJ5zc SbWWLSJ0yJnSvmY8WlP94Id+VVQB09uR03uImCVZFHRSq1M= X-Google-Smtp-Source: APXvYqy3IxNHKYf16WPQ3O092PJ9jXnQDJeGcRoDhh3TG4qVHeslst0/SDi//eIPZFyL1TWpd78gCLPa/y51793gAoo= X-Received: by 2002:a17:90a:1150:: with SMTP id d16mr24309266pje.2.1569803719427; Sun, 29 Sep 2019 17:35:19 -0700 (PDT) MIME-Version: 1.0 From: Stefan Kangas Date: Mon, 30 Sep 2019 02:35:08 +0200 Message-ID: Subject: Re: bug#20258: 24.5; format-time-string miscounting of multibyte characters To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 20258-done Cc: 20258-done@debbugs.gnu.org, Gunnar Horrigmo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> From: Gunnar Horrigmo >> Date: Sat, 04 Apr 2015 16:33:50 +0200 >> >> >> As the subject says, format-time-string miscounts multibyte characters. >> Simple example with nb_NO.utf8 locale, where =C3=B8 is two bytes: >> >> (format-time-string "%6a" (date-to-time "Sat Apr 4 16:14:40 2015")) >> " l=C3=B8." >> >> (length (format-time-string "%6a" (date-to-time "Sat Apr 4 16:14:40 201= 5"))) >> 5 > > 'length' counts characters, not bytes. If you need to count bytes, > use 'string-bytes' instead: > > (string-bytes " l=C3=B8.") =3D> 6 I can see no bug here, only a misunderstanding about the length function. I'm therefore closing this bug. If that's incorrect, please reopen this bug report. Best regards, Stefan Kangas From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 29 23:09:17 2019 Received: (at 20258) by debbugs.gnu.org; 30 Sep 2019 03:09:17 +0000 Received: from localhost ([127.0.0.1]:56425 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEm3o-0001S6-RA for submit@debbugs.gnu.org; Sun, 29 Sep 2019 23:09:17 -0400 Received: from quimby.gnus.org ([80.91.231.51]:41078) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEm3m-0001Rr-Cr for 20258@debbugs.gnu.org; Sun, 29 Sep 2019 23:09:14 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iEm3h-0001q3-BA; Mon, 30 Sep 2019 05:09:11 +0200 From: Lars Ingebrigtsen To: 20258@debbugs.gnu.org Subject: Re: bug#20258: 24.5; format-time-string miscounting of multibyte characters References: Date: Mon, 30 Sep 2019 05:09:08 +0200 In-Reply-To: (Stefan Kangas's message of "Mon, 30 Sep 2019 02:35:08 +0200") Message-ID: <87blv2a3aj.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Stefan Kangas writes: >>> As the subject says, format-time-string miscounts multibyte characters. >>> Simple example with nb_NO.utf8 locale, where ø is two bytes: >>> >>> (format-time-string "%6a" (date-to-time "Sat Apr 4 [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 20258 Cc: stefan@marxist.se, gunnar.horrigmo@usit.uio.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Kangas writes: >>> As the subject says, format-time-string miscounts multibyte characters. >>> Simple example with nb_NO.utf8 locale, where =C3=B8 is two bytes: >>> >>> (format-time-string "%6a" (date-to-time "Sat Apr 4 16:14:40 2015")) >>> " l=C3=B8." >>> >>> (length (format-time-string "%6a" (date-to-time "Sat Apr 4 16:14:40 20= 15"))) >>> 5 >> >> 'length' counts characters, not bytes. If you need to count bytes, >> use 'string-bytes' instead: >> >> (string-bytes " l=C3=B8.") =3D> 6 > > I can see no bug here, only a misunderstanding about the length > function. I'm therefore closing this bug. If that's incorrect, please > reopen this bug report. But the issue here is that "%6a" should give you a string that's six characters long, I think? Admittedly the doc string is vague here: --- A field width N is an unsigned decimal integer with a leading digit nonzero. %NX is like %X, but takes up at least N positions. --- But the natural interpretation of "positions" isn't bytes, I think, and if is, then the doc string should say so. (let ((system-time-locale "nb_NO.UTF-8")) (format-time-string "%6a" (date-to-time "Sat Apr 4 16:14:40 2015"))) =3D> " l=C3=B8." (if you have that locale in /etc/locale.gen.) But I seem to remember from previous discussions that this quirk is in the C strftime function? And Emacs just call it? I haven't checked. But this means that you can't use format-time-string to line stuff up, but have to use `format': (let ((system-time-locale "nb_NO.UTF-8")) (format "%6s" (format-time-string "%a" (date-to-time "Sat Apr 4 16:14:40= 2015")))) =3D> " l=C3=B8." So I think what WIDTH means should be said explicitly in the doc string. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 30 03:01:36 2019 Received: (at 20258) by debbugs.gnu.org; 30 Sep 2019 07:01:36 +0000 Received: from localhost ([127.0.0.1]:56665 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEpge-0006pS-1R for submit@debbugs.gnu.org; Mon, 30 Sep 2019 03:01:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59256) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEpgc-0006pB-66 for 20258@debbugs.gnu.org; Mon, 30 Sep 2019 03:01:34 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33864) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iEpgR-0000u9-UR; Mon, 30 Sep 2019 03:01:24 -0400 Received: from [176.228.60.248] (port=2367 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iEpgP-00061G-KI; Mon, 30 Sep 2019 03:01:22 -0400 Date: Mon, 30 Sep 2019 10:01:17 +0300 Message-Id: <83d0fie08y.fsf@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen In-reply-to: <87blv2a3aj.fsf@gnus.org> (message from Lars Ingebrigtsen on Mon, 30 Sep 2019 05:09:08 +0200) Subject: Re: bug#20258: 24.5; format-time-string miscounting of multibyte characters References: <87blv2a3aj.fsf@gnus.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 20258 Cc: 20258@debbugs.gnu.org, stefan@marxist.se, gunnar.horrigmo@usit.uio.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Lars Ingebrigtsen > Date: Mon, 30 Sep 2019 05:09:08 +0200 > Cc: stefan@marxist.se, gunnar.horrigmo@usit.uio.no > > A field width N is an unsigned decimal integer with a leading digit nonzero. > %NX is like %X, but takes up at least N positions. > --- > > But the natural interpretation of "positions" isn't bytes, I think, and > if is, then the doc string should say so. > > (let ((system-time-locale "nb_NO.UTF-8")) > (format-time-string "%6a" (date-to-time "Sat Apr 4 16:14:40 2015"))) > => " lø." > > (if you have that locale in /etc/locale.gen.) > > But I seem to remember from previous discussions that this quirk is in > the C strftime function? And Emacs just call it? Yes, that's true. > So I think what WIDTH means should be said explicitly in the doc string. It can only warn that WIDTH _might_ be measured in bytes, since the underlying implementation of strftime just might DTRT. Or not. I think this should be raised as a bug to glibc developers, as their documentation says "characters", according to my reading. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 30 04:41:34 2019 Received: (at 20258) by debbugs.gnu.org; 30 Sep 2019 08:41:34 +0000 Received: from localhost ([127.0.0.1]:56909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iErFN-0005Az-Kk for submit@debbugs.gnu.org; Mon, 30 Sep 2019 04:41:33 -0400 Received: from mx2.suse.de ([195.135.220.15]:43896 helo=mx1.suse.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iErFL-0005Al-1w for 20258@debbugs.gnu.org; Mon, 30 Sep 2019 04:41:31 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id CDDBAADCC; Mon, 30 Sep 2019 08:41:24 +0000 (UTC) From: Andreas Schwab To: Eli Zaretskii Subject: Re: bug#20258: 24.5; format-time-string miscounting of multibyte characters References: <87blv2a3aj.fsf@gnus.org> <83d0fie08y.fsf@gnu.org> X-Yow: I've gotta GO, now!! I wanta tell you you're a GREAT bunch of guys but you ought to CHANGE your UNDERWEAR more often!! Date: Mon, 30 Sep 2019 10:41:23 +0200 In-Reply-To: <83d0fie08y.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 30 Sep 2019 10:01:17 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 20258 Cc: 20258@debbugs.gnu.org, Lars Ingebrigtsen , stefan@marxist.se, gunnar.horrigmo@usit.uio.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On Sep 30 2019, Eli Zaretskii wrote: > I think this should be raised as a bug to glibc developers, as their > documentation says "characters", according to my reading. The POSIX descriptions says bytes. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 30 05:14:18 2019 Received: (at 20258) by debbugs.gnu.org; 30 Sep 2019 09:14:18 +0000 Received: from localhost ([127.0.0.1]:56943 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iErkz-0005x9-Tq for submit@debbugs.gnu.org; Mon, 30 Sep 2019 05:14:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49498) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iErkx-0005ww-K2 for 20258@debbugs.gnu.org; Mon, 30 Sep 2019 05:14:12 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35915) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iErkq-0005T7-Vy; Mon, 30 Sep 2019 05:14:05 -0400 Received: from [176.228.60.248] (port=2661 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iErkp-0002zf-F1; Mon, 30 Sep 2019 05:14:04 -0400 Date: Mon, 30 Sep 2019 12:13:59 +0300 Message-Id: <83k19qcfjc.fsf@gnu.org> From: Eli Zaretskii To: Andreas Schwab In-reply-to: (message from Andreas Schwab on Mon, 30 Sep 2019 10:41:23 +0200) Subject: Re: bug#20258: 24.5; format-time-string miscounting of multibyte characters References: <87blv2a3aj.fsf@gnus.org> <83d0fie08y.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 20258 Cc: 20258@debbugs.gnu.org, larsi@gnus.org, stefan@marxist.se, gunnar.horrigmo@usit.uio.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Andreas Schwab > Cc: Lars Ingebrigtsen , 20258@debbugs.gnu.org, stefan@marxist.se, gunnar.horrigmo@usit.uio.no > Date: Mon, 30 Sep 2019 10:41:23 +0200 > > On Sep 30 2019, Eli Zaretskii wrote: > > > I think this should be raised as a bug to glibc developers, as their > > documentation says "characters", according to my reading. > > The POSIX descriptions says bytes. Right. So it might be a glibc documentation bug (or maybe the glibc manual I have here is outdated). And there is the issue with non-glibc implementations. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 30 09:39:24 2019 Received: (at 20258) by debbugs.gnu.org; 30 Sep 2019 13:39:24 +0000 Received: from localhost ([127.0.0.1]:57087 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEvtb-0007xL-RH for submit@debbugs.gnu.org; Mon, 30 Sep 2019 09:39:24 -0400 Received: from quimby.gnus.org ([80.91.231.51]:53236) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEvtZ-0007xC-Gf for 20258@debbugs.gnu.org; Mon, 30 Sep 2019 09:39:21 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iEvtU-0001fF-2P; Mon, 30 Sep 2019 15:39:18 +0200 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#20258: 24.5; format-time-string miscounting of multibyte characters References: <87blv2a3aj.fsf@gnus.org> <83d0fie08y.fsf@gnu.org> <83k19qcfjc.fsf@gnu.org> Date: Mon, 30 Sep 2019 15:39:15 +0200 In-Reply-To: <83k19qcfjc.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 30 Sep 2019 12:13:59 +0300") Message-ID: <878sq5ewe4.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eli Zaretskii writes: >> The POSIX descriptions says bytes. > > Right. So it might be a glibc documentation bug (or maybe the glibc > manual I have here is outdated). > > And there is the issue with non-glibc implementatio [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 20258 Cc: 20258@debbugs.gnu.org, Andreas Schwab , stefan@marxist.se, gunnar.horrigmo@usit.uio.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> The POSIX descriptions says bytes. > > Right. So it might be a glibc documentation bug (or maybe the glibc > manual I have here is outdated). > > And there is the issue with non-glibc implementations. What about something appropriately vague like the following patch to draw attention to the issue: diff --git a/src/timefns.c b/src/timefns.c index 330d5623f0..20f7ccb7d7 100644 --- a/src/timefns.c +++ b/src/timefns.c @@ -1437,8 +1437,11 @@ DEFUN ("format-time-string", Fformat_time_string, Sformat_time_string, 1, 3, 0, `^' Use upper case characters if possible. `#' Use opposite case characters if possible. -A field width N is an unsigned decimal integer with a leading digit nonzero. -%NX is like %X, but takes up at least N positions. +A field width N is an unsigned decimal integer with a leading digit +nonzero. %NX is like %X, but takes up at least N positions. The +field width is (on most systems) in bytes, not characters, so it +depends on the locale what the width (in characters) %NX will end up +being. The modifiers are: -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 30 09:59:04 2019 Received: (at 20258) by debbugs.gnu.org; 30 Sep 2019 13:59:04 +0000 Received: from localhost ([127.0.0.1]:59973 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEwCZ-0002qK-AG for submit@debbugs.gnu.org; Mon, 30 Sep 2019 09:59:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40625) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEwCX-0002q5-Bc for 20258@debbugs.gnu.org; Mon, 30 Sep 2019 09:58:57 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:39725) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iEwCR-0006o1-Jy; Mon, 30 Sep 2019 09:58:51 -0400 Received: from [176.228.60.248] (port=4556 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iEwCQ-0007nY-Jl; Mon, 30 Sep 2019 09:58:51 -0400 Date: Mon, 30 Sep 2019 16:58:49 +0300 Message-Id: <834l0tdgx2.fsf@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen In-reply-to: <878sq5ewe4.fsf@gnus.org> (message from Lars Ingebrigtsen on Mon, 30 Sep 2019 15:39:15 +0200) Subject: Re: bug#20258: 24.5; format-time-string miscounting of multibyte characters References: <87blv2a3aj.fsf@gnus.org> <83d0fie08y.fsf@gnu.org> <83k19qcfjc.fsf@gnu.org> <878sq5ewe4.fsf@gnus.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 20258 Cc: 20258@debbugs.gnu.org, schwab@suse.de, stefan@marxist.se, gunnar.horrigmo@usit.uio.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Lars Ingebrigtsen > Cc: Andreas Schwab , 20258@debbugs.gnu.org, > stefan@marxist.se, gunnar.horrigmo@usit.uio.no > Date: Mon, 30 Sep 2019 15:39:15 +0200 > > -A field width N is an unsigned decimal integer with a leading digit nonzero. > -%NX is like %X, but takes up at least N positions. > +A field width N is an unsigned decimal integer with a leading digit > +nonzero. %NX is like %X, but takes up at least N positions. The > +field width is (on most systems) in bytes, not characters, so it "is measured in bytes". Also, I'd say "on GNU/Linux and some other systems", which is marginally more accurate. > +depends on the locale what the width (in characters) %NX will end up > +being. I would mention "non-ASCII characters" here in some way, not just the locale, to make this more explicit. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 30 10:04:51 2019 Received: (at control) by debbugs.gnu.org; 30 Sep 2019 14:04:51 +0000 Received: from localhost ([127.0.0.1]:59987 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEwIF-00053Q-Eb for submit@debbugs.gnu.org; Mon, 30 Sep 2019 10:04:51 -0400 Received: from quimby.gnus.org ([80.91.231.51]:53982) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEwIC-00053I-Vx for control@debbugs.gnu.org; Mon, 30 Sep 2019 10:04:49 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iEwIA-0001wN-Ca for control@debbugs.gnu.org; Mon, 30 Sep 2019 16:04:48 +0200 Date: Mon, 30 Sep 2019 16:04:46 +0200 Message-Id: <87o8z1dgn5.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #20258 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 20258 + patch quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 20258 + patch quit From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 30 10:12:44 2019 Received: (at 20258) by debbugs.gnu.org; 30 Sep 2019 14:12:44 +0000 Received: from localhost ([127.0.0.1]:60000 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEwPs-0005FO-KH for submit@debbugs.gnu.org; Mon, 30 Sep 2019 10:12:44 -0400 Received: from quimby.gnus.org ([80.91.231.51]:54186) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEwPr-0005FG-Jp for 20258@debbugs.gnu.org; Mon, 30 Sep 2019 10:12:44 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iEwPm-00022b-88; Mon, 30 Sep 2019 16:12:40 +0200 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#20258: 24.5; format-time-string miscounting of multibyte characters References: <87blv2a3aj.fsf@gnus.org> <83d0fie08y.fsf@gnu.org> <83k19qcfjc.fsf@gnu.org> <878sq5ewe4.fsf@gnus.org> <834l0tdgx2.fsf@gnu.org> Date: Mon, 30 Sep 2019 16:12:38 +0200 In-Reply-To: <834l0tdgx2.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 30 Sep 2019 16:58:49 +0300") Message-ID: <87k19pdga1.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eli Zaretskii writes: > "is measured in bytes". Also, I'd say "on GNU/Linux and some other > systems", which is marginally more accurate. OK. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 20258 Cc: 20258@debbugs.gnu.org, schwab@suse.de, stefan@marxist.se, gunnar.horrigmo@usit.uio.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > "is measured in bytes". Also, I'd say "on GNU/Linux and some other > systems", which is marginally more accurate. OK. >> +depends on the locale what the width (in characters) %NX will end up >> +being. > > I would mention "non-ASCII characters" here in some way, not just the > locale, to make this more explicit. I was pondering whether any users had a locale of *.UTF-16. Then even the ASCII characters will be subject to the byte/character difference, so I thought it was best to leave even that vague. But perhaps saying something like "especially with non-ASCII characters" wouldn't be too misleading? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 30 10:31:05 2019 Received: (at 20258) by debbugs.gnu.org; 30 Sep 2019 14:31:05 +0000 Received: from localhost ([127.0.0.1]:60039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEwhd-0000Ia-0c for submit@debbugs.gnu.org; Mon, 30 Sep 2019 10:31:05 -0400 Received: from mail-out01.uio.no ([129.240.10.50]:60517) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEwhZ-0000Dt-CB for 20258@debbugs.gnu.org; Mon, 30 Sep 2019 10:31:03 -0400 Received: from mail-mx01.uio.no ([129.240.10.26]) by mail-out01.uio.no with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) (envelope-from ) id 1iEwhW-0001Lf-1U; Mon, 30 Sep 2019 16:30:58 +0200 Received: from hot-rats.uio.no ([129.240.203.151]) by mail-mx01.uio.no with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) user horrigmo (Exim 4.92.2) (envelope-from ) id 1iEwhV-0006um-Gx; Mon, 30 Sep 2019 16:30:57 +0200 From: Gunnar Horrigmo To: Lars Ingebrigtsen Subject: Re: bug#20258: 24.5; format-time-string miscounting of multibyte characters References: <87blv2a3aj.fsf@gnus.org> <83d0fie08y.fsf@gnu.org> <83k19qcfjc.fsf@gnu.org> <878sq5ewe4.fsf@gnus.org> <834l0tdgx2.fsf@gnu.org> <87k19pdga1.fsf@gnus.org> Date: Mon, 30 Sep 2019 16:30:55 +0200 In-Reply-To: <87k19pdga1.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 30 Sep 2019 16:12:38 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-UiO-SPF-Received: Received-SPF: neutral (mail-mx01.uio.no: 129.240.203.151 is neither permitted nor denied by domain of usit.uio.no) client-ip=129.240.203.151; envelope-from=horrigmo@usit.uio.no; helo=hot-rats.uio.no; X-UiO-Spam-info: not spam, SpamAssassin (score=-5.0, required=5.0, autolearn=disabled, UIO_MAIL_IS_INTERNAL=-5, uiobl=NO, uiouri=NO) X-UiO-Scanned: 2BDBBE3742FE2E84D0743DD788782B3A0A0348D3 X-UiOonly: A26D8F274B30E40F7E20DCCD3E56D2180B4959C2 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 20258 Cc: 20258@debbugs.gnu.org, schwab@suse.de, Eli Zaretskii , stefan@marxist.se, gunnar.horrigmo@usit.uio.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Lars Ingebrigtsen writes: > I was pondering whether any users had a locale of *.UTF-16. Windows users might, if that's at all relevant to the discussion. --Gunnar From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 30 10:41:41 2019 Received: (at 20258) by debbugs.gnu.org; 30 Sep 2019 14:41:41 +0000 Received: from localhost ([127.0.0.1]:60062 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEwro-0001hT-De for submit@debbugs.gnu.org; Mon, 30 Sep 2019 10:41:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46181) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEwrl-0001hC-4Y for 20258@debbugs.gnu.org; Mon, 30 Sep 2019 10:41:33 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iEwrf-000321-Ee; Mon, 30 Sep 2019 10:41:27 -0400 Received: from [176.228.60.248] (port=3332 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iEwrd-0000PG-VN; Mon, 30 Sep 2019 10:41:26 -0400 Date: Mon, 30 Sep 2019 17:41:24 +0300 Message-Id: <83y2y5c0dn.fsf@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen In-reply-to: <87k19pdga1.fsf@gnus.org> (message from Lars Ingebrigtsen on Mon, 30 Sep 2019 16:12:38 +0200) Subject: Re: bug#20258: 24.5; format-time-string miscounting of multibyte characters References: <87blv2a3aj.fsf@gnus.org> <83d0fie08y.fsf@gnu.org> <83k19qcfjc.fsf@gnu.org> <878sq5ewe4.fsf@gnus.org> <834l0tdgx2.fsf@gnu.org> <87k19pdga1.fsf@gnus.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 20258 Cc: 20258@debbugs.gnu.org, schwab@suse.de, stefan@marxist.se, gunnar.horrigmo@usit.uio.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Lars Ingebrigtsen > Cc: schwab@suse.de, 20258@debbugs.gnu.org, stefan@marxist.se, > gunnar.horrigmo@usit.uio.no > Date: Mon, 30 Sep 2019 16:12:38 +0200 > > > I would mention "non-ASCII characters" here in some way, not just the > > locale, to make this more explicit. > > I was pondering whether any users had a locale of *.UTF-16. Unlikely. > But perhaps saying something like "especially with non-ASCII characters" > wouldn't be too misleading? Yes, that's what I had in mind. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 30 10:44:37 2019 Received: (at 20258) by debbugs.gnu.org; 30 Sep 2019 14:44:38 +0000 Received: from localhost ([127.0.0.1]:60074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEwuf-0001n6-9g for submit@debbugs.gnu.org; Mon, 30 Sep 2019 10:44:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46709) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEwue-0001ms-2V for 20258@debbugs.gnu.org; Mon, 30 Sep 2019 10:44:32 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40586) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iEwuY-0003nj-TL; Mon, 30 Sep 2019 10:44:26 -0400 Received: from [176.228.60.248] (port=3516 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iEwuY-0000eQ-E6; Mon, 30 Sep 2019 10:44:26 -0400 Date: Mon, 30 Sep 2019 17:44:24 +0300 Message-Id: <83wodpc08n.fsf@gnu.org> From: Eli Zaretskii To: Gunnar Horrigmo In-reply-to: (message from Gunnar Horrigmo on Mon, 30 Sep 2019 16:30:55 +0200) Subject: Re: bug#20258: 24.5; format-time-string miscounting of multibyte characters References: <87blv2a3aj.fsf@gnus.org> <83d0fie08y.fsf@gnu.org> <83k19qcfjc.fsf@gnu.org> <878sq5ewe4.fsf@gnus.org> <834l0tdgx2.fsf@gnu.org> <87k19pdga1.fsf@gnus.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 20258 Cc: 20258@debbugs.gnu.org, schwab@suse.de, larsi@gnus.org, stefan@marxist.se, gunnar.horrigmo@usit.uio.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Gunnar Horrigmo > Cc: Eli Zaretskii , , > <20258@debbugs.gnu.org>, , > > Date: Mon, 30 Sep 2019 16:30:55 +0200 > > Lars Ingebrigtsen writes: > > > I was pondering whether any users had a locale of *.UTF-16. > > Windows users might I don't think so. AFAIK, UTF-16 is not a valid codeset of any Windows locale. Windows uses UTF-16 internally, and exposes it in the Windows APIs, but APIs that came from Posix (and locale is one of them) only support single-byte and DBCS encodings as their codeset. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 30 10:48:27 2019 Received: (at 20258) by debbugs.gnu.org; 30 Sep 2019 14:48:27 +0000 Received: from localhost ([127.0.0.1]:60096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEwyR-0003xS-LS for submit@debbugs.gnu.org; Mon, 30 Sep 2019 10:48:27 -0400 Received: from quimby.gnus.org ([80.91.231.51]:54880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEwyP-0003xH-Vv for 20258@debbugs.gnu.org; Mon, 30 Sep 2019 10:48:27 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iEwyI-0002RJ-Mx; Mon, 30 Sep 2019 16:48:21 +0200 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#20258: 24.5; format-time-string miscounting of multibyte characters References: <87blv2a3aj.fsf@gnus.org> <83d0fie08y.fsf@gnu.org> <83k19qcfjc.fsf@gnu.org> <878sq5ewe4.fsf@gnus.org> <834l0tdgx2.fsf@gnu.org> <87k19pdga1.fsf@gnus.org> <83y2y5c0dn.fsf@gnu.org> Date: Mon, 30 Sep 2019 16:48:18 +0200 In-Reply-To: <83y2y5c0dn.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 30 Sep 2019 17:41:24 +0300") Message-ID: <871rvxdeml.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eli Zaretskii writes: >> But perhaps saying something like "especially with non-ASCII characters" >> wouldn't be too misleading? > > Yes, that's what I had in mind. OK; doc string updated accordingly, and I'm closing this bug report. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 20258 Cc: 20258@debbugs.gnu.org, schwab@suse.de, stefan@marxist.se, gunnar.horrigmo@usit.uio.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> But perhaps saying something like "especially with non-ASCII characters" >> wouldn't be too misleading? > > Yes, that's what I had in mind. OK; doc string updated accordingly, and I'm closing this bug report. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 30 10:48:32 2019 Received: (at control) by debbugs.gnu.org; 30 Sep 2019 14:48:32 +0000 Received: from localhost ([127.0.0.1]:60098 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEwyV-0003xj-Ti for submit@debbugs.gnu.org; Mon, 30 Sep 2019 10:48:32 -0400 Received: from quimby.gnus.org ([80.91.231.51]:54892) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEwyR-0003xK-4c for control@debbugs.gnu.org; Mon, 30 Sep 2019 10:48:27 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iEwyO-0002RR-Ap for control@debbugs.gnu.org; Mon, 30 Sep 2019 16:48:26 +0200 Date: Mon, 30 Sep 2019 16:48:24 +0200 Message-Id: <87zhilc01z.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #20258 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 20258 fixed close 20258 27.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 20258 fixed close 20258 27.1 quit From unknown Fri Jun 20 07:11:54 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 29 Oct 2019 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator