From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.bugs Subject: bug#20258: 24.5; format-time-string miscounting of multibyte characters Date: Sat, 04 Apr 2015 18:42:29 +0200 Message-ID: <87egnzj156.fsf@igel.home> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1428165800 29485 80.91.229.3 (4 Apr 2015 16:43:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 4 Apr 2015 16:43:20 +0000 (UTC) Cc: 20258@debbugs.gnu.org To: Gunnar Horrigmo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 04 18:43:11 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YeRA6-0002Og-R1 for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Apr 2015 18:43:10 +0200 Original-Received: from localhost ([::1]:33766 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YeRA6-0001XN-8l for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 Apr 2015 12:43:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51587) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YeRA2-0001XG-KM for bug-gnu-emacs@gnu.org; Sat, 04 Apr 2015 12:43:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YeR9z-0004yh-E2 for bug-gnu-emacs@gnu.org; Sat, 04 Apr 2015 12:43:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YeR9z-0004yc-7i for bug-gnu-emacs@gnu.org; Sat, 04 Apr 2015 12:43:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YeR9y-0000NF-HS for bug-gnu-emacs@gnu.org; Sat, 04 Apr 2015 12:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andreas Schwab Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Apr 2015 16:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20258 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20258-submit@debbugs.gnu.org id=B20258.14281657541404 (code B ref 20258); Sat, 04 Apr 2015 16:43:02 +0000 Original-Received: (at 20258) by debbugs.gnu.org; 4 Apr 2015 16:42:34 +0000 Original-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 Original-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 Original-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) Original-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 Original-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 Original-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) Original-Received: by igel.home (Postfix, from userid 1000) id 4A6AA2C3A3A; Sat, 4 Apr 2015 18:42:29 +0200 (CEST) X-Yow: Are we THERE yet?? In-Reply-To: (Gunnar Horrigmo's message of "Sat, 04 Apr 2015 16:33:50 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:101194 Archived-At: 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."