From: Ismail Donmez <ismail@i10z.com>
To: zsh-workers@zsh.org
Subject: Re: invalid characters and multi-byte [x-y] ranges
Date: Fri, 4 Sep 2015 10:53:14 +0000 (UTC) [thread overview]
Message-ID: <loom.20150904T125242-645@post.gmane.org> (raw)
In-Reply-To: <20150903151811.557a40ec@pwslap01u.europe.root.pri>
Hi,
Peter Stephenson <p.stephenson <at> samsung.com> writes:
>
> On Thu, 3 Sep 2015 11:09:44 +0100
> Stephane Chazelas <stephane.chazelas <at> gmail.com> wrote:
> > A discussed approach there was to internally represent bytes not
> > forming part of a valid character as code points in the range
> > D800-DFFF (specifically DC80 DCFF for bytes 0x80 to 0xff)
>
> That's easy if wchar_t is actually Unicode.
>
> I'm not sure how to do it otherwise. We could treat it identically to
> the Unicode conversion of 0xdC00 + STOUCH(ch) to wchar_t, e.g. iconv
> UCS-4 to WCHAR_T, but is that guranteed to work? This needs to be a
> robust fallback and it's not clear relying on iconv is the right thing
> to do.
>
> The safe option would be only to use this if #ifdef __STDC_ISO_10646__.
>
> On the other hand, it's probably not going to be worse than the previous
> code...
This seems to break glob tests:
./D02glob.ztst: starting.
*** /tmp/zsh.ztst.out.6468 Fri Sep 4 13:52:19 2015
--- /tmp/zsh.ztst.tout.6468 Fri Sep 4 13:52:19 2015
***************
*** 91,107 ****
0: [[ [ = [[] ]]
0: [[ ] = []] ]]
0: [[ [] = [^]]] ]]
! 0: [[ fooxx = (#i)FOOXX ]]
1: [[ fooxx = (#l)FOOXX ]]
! 0: [[ FOOXX = (#l)fooxx ]]
1: [[ fooxx = (#i)FOO(#I)X(#i)X ]]
! 0: [[ fooXx = (#i)FOO(#I)X(#i)X ]]
! 0: [[ fooxx = ((#i)FOOX)x ]]
1: [[ fooxx = ((#i)FOOX)X ]]
1: [[ BAR = (bar|(#i)foo) ]]
! 0: [[ FOO = (bar|(#i)foo) ]]
! 0: [[ Modules = (#i)*m* ]]
! 0: [[ fooGRUD = (#i)(bar|(#I)foo|(#i)rod)grud ]]
1: [[ FOOGRUD = (#i)(bar|(#I)foo|(#i)rod)grud ]]
0: [[ readme = (#i)readme~README|readme ]]
0: [[ readme = (#i)readme~README|readme~README ]]
--- 91,114 ----
0: [[ [ = [[] ]]
0: [[ ] = []] ]]
0: [[ [] = [^]]] ]]
! 1: [[ fooxx = (#i)FOOXX ]]
! Test failed: [[ fooxx = (#i)FOOXX ]]
1: [[ fooxx = (#l)FOOXX ]]
! 1: [[ FOOXX = (#l)fooxx ]]
! Test failed: [[ FOOXX = (#l)fooxx ]]
1: [[ fooxx = (#i)FOO(#I)X(#i)X ]]
! 1: [[ fooXx = (#i)FOO(#I)X(#i)X ]]
! Test failed: [[ fooXx = (#i)FOO(#I)X(#i)X ]]
! 1: [[ fooxx = ((#i)FOOX)x ]]
! Test failed: [[ fooxx = ((#i)FOOX)x ]]
1: [[ fooxx = ((#i)FOOX)X ]]
1: [[ BAR = (bar|(#i)foo) ]]
! 1: [[ FOO = (bar|(#i)foo) ]]
! Test failed: [[ FOO = (bar|(#i)foo) ]]
! 1: [[ Modules = (#i)*m* ]]
! Test failed: [[ Modules = (#i)*m* ]]
! 1: [[ fooGRUD = (#i)(bar|(#I)foo|(#i)rod)grud ]]
! Test failed: [[ fooGRUD = (#i)(bar|(#I)foo|(#i)rod)grud ]]
1: [[ FOOGRUD = (#i)(bar|(#I)foo|(#i)rod)grud ]]
0: [[ readme = (#i)readme~README|readme ]]
0: [[ readme = (#i)readme~README|readme~README ]]
***************
*** 110,122 ****
0: [[ 633 = <1->33 ]]
0: [[ 633 = <->33 ]]
0: [[
12345678901234567890123456789012345678901234567890123456789012345678901234
567890foo = <42->foo ]]
! 0: [[ READ.ME = (#ia1)readme ]]
1: [[ READ..ME = (#ia1)readme ]]
! 0: [[ README = (#ia1)readm ]]
! 0: [[ READM = (#ia1)readme ]]
! 0: [[ README = (#ia1)eadme ]]
! 0: [[ EADME = (#ia1)readme ]]
! 0: [[ READEM = (#ia1)readme ]]
1: [[ ADME = (#ia1)readme ]]
1: [[ README = (#ia1)read ]]
0: [[ bob = (#a1)[b][b] ]]
--- 117,135 ----
0: [[ 633 = <1->33 ]]
0: [[ 633 = <->33 ]]
0: [[
12345678901234567890123456789012345678901234567890123456789012345678901234
567890foo = <42->foo ]]
! 1: [[ READ.ME = (#ia1)readme ]]
! Test failed: [[ READ.ME = (#ia1)readme ]]
1: [[ READ..ME = (#ia1)readme ]]
! 1: [[ README = (#ia1)readm ]]
! Test failed: [[ README = (#ia1)readm ]]
! 1: [[ READM = (#ia1)readme ]]
! Test failed: [[ READM = (#ia1)readme ]]
! 1: [[ README = (#ia1)eadme ]]
! Test failed: [[ README = (#ia1)eadme ]]
! 1: [[ EADME = (#ia1)readme ]]
! Test failed: [[ EADME = (#ia1)readme ]]
! 1: [[ READEM = (#ia1)readme ]]
! Test failed: [[ READEM = (#ia1)readme ]]
1: [[ ADME = (#ia1)readme ]]
1: [[ README = (#ia1)read ]]
0: [[ bob = (#a1)[b][b] ]]
***************
*** 138,144 ****
0: [[ aaaXaaabY = (#a1)(a##b)##Y ]]
0: [[ aaaXbaabY = (#a1)(a##b)##Y ]]
1: [[ read.me = (#ia1)README~READ.ME ]]
! 0: [[ read.me = (#ia1)README~READ_ME ]]
1: [[ read.me = (#ia1)README~(#a1)READ_ME ]]
0: [[ test = *((#s)|/)test((#e)|/)* ]]
0: [[ test/path = *((#s)|/)test((#e)|/)* ]]
--- 151,158 ----
0: [[ aaaXaaabY = (#a1)(a##b)##Y ]]
0: [[ aaaXbaabY = (#a1)(a##b)##Y ]]
1: [[ read.me = (#ia1)README~READ.ME ]]
! 1: [[ read.me = (#ia1)README~READ_ME ]]
! Test failed: [[ read.me = (#ia1)README~READ_ME ]]
1: [[ read.me = (#ia1)README~(#a1)READ_ME ]]
0: [[ test = *((#s)|/)test((#e)|/)* ]]
0: [[ test/path = *((#s)|/)test((#e)|/)* ]]
***************
*** 177,180 ****
0: [[ test.bash = *.?(#c1,2)sh ]]
0: [[ test.bash = *.?(#c1,)sh ]]
0: [[ test.zsh = *.?(#c1,)sh ]]
! 0 tests failed.
--- 191,194 ----
0: [[ test.bash = *.?(#c1,2)sh ]]
0: [[ test.bash = *.?(#c1,)sh ]]
0: [[ test.zsh = *.?(#c1,)sh ]]
! 14 tests failed.
Test ./D02glob.ztst failed: output differs from expected as shown above
for:
globtest globtests
Was testing: zsh globbing
next prev parent reply other threads:[~2015-09-04 10:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-02 23:07 Stephane Chazelas
2015-09-03 9:00 ` Peter Stephenson
2015-09-03 10:09 ` Stephane Chazelas
2015-09-03 14:18 ` Peter Stephenson
2015-09-04 10:53 ` Ismail Donmez [this message]
2015-09-04 11:47 ` Peter Stephenson
2015-09-04 12:35 ` Peter Stephenson
2015-09-04 15:02 ` Ismail Donmez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=loom.20150904T125242-645@post.gmane.org \
--to=ismail@i10z.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).