* multibyte/utf8/unicode issues with 'sched' builtin @ 2008-03-22 3:59 Mikael Magnusson 2008-03-23 1:00 ` Bart Schaefer 2008-03-25 17:34 ` Peter Stephenson 0 siblings, 2 replies; 3+ messages in thread From: Mikael Magnusson @ 2008-03-22 3:59 UTC (permalink / raw) To: zsh-workers Today is saturday in sweden, one of three days of the week with a nonascii character in the first three letters of the name of the day. % LC_ALL=C zsh -f % sched +1 true; sched 1 Sat Mar 22 4:55:46 true so far so good... % LC_ALL=sv_SE.UTF-8 zsh -f % sched +1 true; sched 1 lör mar 22 4:57pاÄ true ^[[?1;2c % 1;2c not so good. Have fun? :) (Yes, the terminal is set to utf8, everything else works fine) -- Mikael Magnusson ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: multibyte/utf8/unicode issues with 'sched' builtin 2008-03-22 3:59 multibyte/utf8/unicode issues with 'sched' builtin Mikael Magnusson @ 2008-03-23 1:00 ` Bart Schaefer 2008-03-25 17:34 ` Peter Stephenson 1 sibling, 0 replies; 3+ messages in thread From: Bart Schaefer @ 2008-03-23 1:00 UTC (permalink / raw) To: zsh-workers On Mar 22, 4:59am, Mikael Magnusson wrote: } } nonascii character in the first three letters of the name of the day. } } % sched +1 true; sched } 1 lor mar 22 4:57p0x0627A true This is a string built with ztrftime() and output with printf() so if I'd expect similar problems to show up in other places. Unfortunately I don't know what to do about it, so unless someone else jumps in we'll have to wait for PWS to get back. } ^[[?1;2c } % 1;2c That's just the terminal being confused by escape sequences in the prompt, because something unexpected happened with the printf(). Not really related. ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: multibyte/utf8/unicode issues with 'sched' builtin 2008-03-22 3:59 multibyte/utf8/unicode issues with 'sched' builtin Mikael Magnusson 2008-03-23 1:00 ` Bart Schaefer @ 2008-03-25 17:34 ` Peter Stephenson 1 sibling, 0 replies; 3+ messages in thread From: Peter Stephenson @ 2008-03-25 17:34 UTC (permalink / raw) To: zsh-workers On Sat, 22 Mar 2008 04:59:02 +0100 "Mikael Magnusson" <mikachu@gmail.com> wrote: > % LC_ALL=sv_SE.UTF-8 zsh -f > % sched +1 true; sched > 1 lör mar 22 4:57pاÄ true > ^[[?1;2c > % 1;2c > > not so good. I hope it's this simple, if not I'll wait till Saturday and look again... I haven't scientifically counted how many characters we are theoretically liable for, but adding another 20 to cover the remains of the day, month and am/pm should surely be enough, shouldn't it? Index: Src/Builtins/sched.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Builtins/sched.c,v retrieving revision 1.13 diff -u -r1.13 sched.c --- Src/Builtins/sched.c 6 Jul 2007 21:52:40 -0000 1.13 +++ Src/Builtins/sched.c 25 Mar 2008 17:33:27 -0000 @@ -205,13 +205,13 @@ /* given no arguments, display the schedule list */ if (!*argptr) { for (sn = 1, sch = schedcmds; sch; sch = sch->next, sn++) { - char tbuf[40], *flagstr, *endstr; + char tbuf[60], *flagstr, *endstr; time_t t; struct tm *tmp; t = sch->time; tmp = localtime(&t); - ztrftime(tbuf, 20, "%a %b %e %k:%M:%S", tmp); + ztrftime(tbuf, 40, "%a %b %e %k:%M:%S", tmp); if (sch->flags & SCHEDFLAG_TRASH_ZLE) flagstr = "-o "; else -- Peter Stephenson <p.w.stephenson@ntlworld.com> Web page now at http://homepage.ntlworld.com/p.w.stephenson/ ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-03-25 17:35 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2008-03-22 3:59 multibyte/utf8/unicode issues with 'sched' builtin Mikael Magnusson 2008-03-23 1:00 ` Bart Schaefer 2008-03-25 17:34 ` Peter Stephenson
Code repositories for project(s) associated with this public inbox https://git.vuxu.org/mirror/zsh/ 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 NNTP newsgroup(s).