unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#20258: 24.5; format-time-string miscounting of multibyte characters
@ 2015-04-04 14:33 Gunnar Horrigmo
  2015-04-04 15:42 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Gunnar Horrigmo @ 2015-04-04 14:33 UTC (permalink / raw)
  To: 20258


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

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.14000
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/horrigmo/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))


-- 
Gunnar





^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-09-30 14:48 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-04 14:33 bug#20258: 24.5; format-time-string miscounting of multibyte characters Gunnar Horrigmo
2015-04-04 15:42 ` Eli Zaretskii
2015-04-04 16:03   ` Stefan Monnier
2015-04-04 16:42 ` Andreas Schwab
2019-09-30  0:35 ` Stefan Kangas
2019-09-30  3:09   ` Lars Ingebrigtsen
2019-09-30  7:01     ` Eli Zaretskii
2019-09-30  8:41       ` Andreas Schwab
2019-09-30  9:13         ` Eli Zaretskii
2019-09-30 13:39           ` Lars Ingebrigtsen
2019-09-30 13:58             ` Eli Zaretskii
2019-09-30 14:12               ` Lars Ingebrigtsen
2019-09-30 14:30                 ` Gunnar Horrigmo
2019-09-30 14:44                   ` Eli Zaretskii
2019-09-30 14:41                 ` Eli Zaretskii
2019-09-30 14:48                   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).