Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: mkdir builtin and $'\0'



2015-08-18 12:27:55 +0100, Peter Stephenson:
> On Tue, 18 Aug 2015 12:11:34 +0100
> Stephane Chazelas <stephane.chazelas@xxxxxxxxx> wrote:
> > $ strftime $'%Y\0%m\0%d' 0 | sed -n l
> > 1970\203 01\203 01$
> 
> This should fix that one.
[...]

Thanks, though it seems to have broken some internationalisation
support. I was trying to see what would happen for month names
that include that \203 byte (like October in ar_AE.UTF-8), but
it seems to also break with some other byte values:

Without the fix:

~$ LC_ALL=ar_AE.UTF-8 date -d @0 +%b | hd
00000000  d9 8a d9 86 d8 a7 0a                              |.......|
00000007
~$ LC_ALL=ar_AE.UTF-8 strftime %b 0  | hd
00000000  d9 8a d9 86 d8 a7 0a                              |.......|
00000007

With the git head:

~$ LC_ALL=ar_AE.UTF-8 strftime %b 0  | hd
00000000  d9 d9 d8 a7 0a                                    |.....|
00000005

I suppose those 8a 86 are special as well.

For \203 0x83:

~$ LC_ALL=ar_AE.UTF-8 date -d @1443697200 +%b | hd
00000000  d8 a3 d9 83 d8 aa 0a                              |.......|
00000007
~$ LC_ALL=ar_AE.UTF-8 strftime %b 1443697200 | hd
00000000  d8 a3 d9 f8 aa 0a                                 |......|
00000006

-- 
Stephane



Messages sorted by: Reverse Date, Date, Thread, Author