From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#3687: 23.1.50; inconsistency in multibyte eight-bit regexps [PATCH] Date: Fri, 28 Jun 2019 14:41:51 +0200 Message-ID: References: <200906260956.n5Q9uo917123@church.math.s.chiba-u.ac.jp> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_B17C82BC-7896-44D6-95E5-730AD2093CAA" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="216013"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 3687@debbugs.gnu.org To: mituharu@math.s.chiba-u.ac.jp, Stefan Monnier , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 28 15:12:29 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hgqfy-000u0c-0p for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Jun 2019 15:12:26 +0200 Original-Received: from localhost ([::1]:59672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgqfw-0004ss-TZ for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Jun 2019 09:12:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39820) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgqCY-000451-W4 for bug-gnu-emacs@gnu.org; Fri, 28 Jun 2019 08:42:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgqCY-0007sJ-3g for bug-gnu-emacs@gnu.org; Fri, 28 Jun 2019 08:42:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55198) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hgqCX-0007s5-Us for bug-gnu-emacs@gnu.org; Fri, 28 Jun 2019 08:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hgqCX-0001iN-RD for bug-gnu-emacs@gnu.org; Fri, 28 Jun 2019 08:42:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <200906260956.n5Q9uo917123@church.math.s.chiba-u.ac.jp> Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Jun 2019 12:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 3687 X-GNU-PR-Package: emacs Original-Received: via spool by 3687-submit@debbugs.gnu.org id=B3687.15617257206584 (code B ref 3687); Fri, 28 Jun 2019 12:42:01 +0000 Original-Received: (at 3687) by debbugs.gnu.org; 28 Jun 2019 12:42:00 +0000 Original-Received: from localhost ([127.0.0.1]:40509 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgqCW-0001i7-Cl for submit@debbugs.gnu.org; Fri, 28 Jun 2019 08:42:00 -0400 Original-Received: from mail232c50.megamailservers.eu ([91.136.10.242]:45672 helo=mail37c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgqCU-0001hy-3J for 3687@debbugs.gnu.org; Fri, 28 Jun 2019 08:41:59 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1561725716; bh=Z2jOqqbZvZEKUfwbZD7a9hrRQNsWP37VxadPaEylqkg=; h=From:Subject:Date:Cc:To:From; b=LFPKbH2f16XyHFdvJiH4xZLE7ENI+uOClFPn3A0AN+oN3VZiS6AvAcoqI4KXK/XMO ztouXbWqAzPu6mnJhj/B94QwXKlZD0nVshST95WmmfI8Is5J2EWYupbheMJArgFAIz uIwfQu/GUjPdFLstKSDC0T+RbTfPCtHcHC36sh0s= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.1.65] (c-e636e253.032-75-73746f71.bbcust.telenor.se [83.226.54.230]) (authenticated bits=0) by mail37c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x5SCfp8p021240; Fri, 28 Jun 2019 12:41:54 +0000 X-Mailer: Apple Mail (2.3445.104.11) X-CTCH-RefID: str=0001.0A0B020D.5D160B14.0001, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=Mot8FVSe c=1 sm=1 tr=0 a=M+GU/qJco4WXjv8D6jB2IA==:117 a=M+GU/qJco4WXjv8D6jB2IA==:17 a=F0cgdpmTucWLag0wYmsA:9 a=CjuIK1q_8ugA:10 a=2fV42GiVEa-fYPVLWyEA:9 a=B2y7HmGcmWMA:10 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:161713 Archived-At: --Apple-Mail=_B17C82BC-7896-44D6-95E5-730AD2093CAA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Let's assume the following semantics as desirable: 1. All characters and raw bytes (up to regexp syntax) match themselves = no matter whether they are given as literals or in character = alternatives. 2. All raw bytes C match themselves and nothing else no matter whether = the pattern or target string/buffer are unibyte or multibyte. 3. Ranges from ASCII to raw bytes work as expected and do not contain = Unicode characters above U+007F. 4. Ranges from non-ASCII Unicode characters to raw bytes make no sense = and are treated as empty. Here is a patch. --Apple-Mail=_B17C82BC-7896-44D6-95E5-730AD2093CAA Content-Disposition: attachment; filename=0001-Correct-regexp-matching-of-raw-bytes.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Correct-regexp-matching-of-raw-bytes.patch" Content-Transfer-Encoding: quoted-printable =46rom=206683077bf5d9509abbae050e1aa4c3dddae1bba9=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Fri,=2028=20Jun=202019=2010:20:55=20+0200=0A= Subject:=20[PATCH]=20Correct=20regexp=20matching=20of=20raw=20bytes=0A=0A= Make=20regexp=20matching=20of=20raw=20bytes=20work=20in=20all=20= combination=20of=20unibyte=0Aand=20multibyte=20patterns=20and=20targets,=20= as=20exact=20strings=20and=20in=20character=0Aalternatives=20(bug#3687).=0A= =0A*=20src/regex-emacs.c=20(analyze_first):=0AInclude=20raw=20byte=20in=20= fastmap=20when=20pattern=20is=20a=20multibyte=20exact=20string.=0A= Include=20leading=20byte=20in=20fastmap=20for=20raw=20bytes=20in=20= character=20alternatives.=0A(re_match_2_internal):=0ADecrement=20the=20= byte=20count=20by=20the=20number=20of=20bytes=20in=20the=20pattern=20= character,=0Anot=201.=0A*=20test/src/regex-emacs-tests.el=20= (regexp-unibyte-unibyte)=0A(regexp-multibyte-unibyte,=20= regexp-unibyte-mutibyte)=0A(regexp-multibyte-multibyte):=20New=20tests.=0A= ---=0A=20src/regex-emacs.c=20=20=20=20=20=20=20=20=20=20=20=20=20|=20=20= 24=20+++++--=0A=20test/src/regex-emacs-tests.el=20|=20120=20= ++++++++++++++++++++++++++++++++++=0A=202=20files=20changed,=20140=20= insertions(+),=204=20deletions(-)=0A=0Adiff=20--git=20= a/src/regex-emacs.c=20b/src/regex-emacs.c=0Aindex=20= c353a78fb4..5887eaa30c=20100644=0A---=20a/src/regex-emacs.c=0A+++=20= b/src/regex-emacs.c=0A@@=20-2794,6=20+2794,7=20@@=20static=20int=0A=20= analyze_first=20(re_char=20*p,=20re_char=20*pend,=20char=20*fastmap,=20= bool=20multibyte)=0A=20{=0A=20=20=20int=20j,=20k;=0A+=20=20int=20nbits;=0A= =20=20=20bool=20not;=0A=20=0A=20=20=20/*=20If=20all=20elements=20for=20= base=20leading-codes=20in=20fastmap=20is=20set,=20this=0A@@=20-2854,7=20= +2855,14=20@@=20analyze_first=20(re_char=20*p,=20re_char=20*pend,=20char=20= *fastmap,=20bool=20multibyte)=0A=20=09=09=20each=20byte=20is=20a=20= character.=20=20Thus,=20this=20works=20in=20both=0A=20=09=09=20cases.=20= */=0A=20=09=20=20=20=20=20=20fastmap[p[1]]=20=3D=201;=0A-=09=20=20=20=20=20= =20if=20(!=20multibyte)=0A+=09=20=20=20=20=20=20if=20(multibyte)=0A+=09=09= {=0A+=09=09=20=20/*=20Cover=20the=20case=20of=20matching=20a=20raw=20= char=20in=20a=0A+=09=09=20=20=20=20=20multibyte=20regexp=20against=20= unibyte.=09*/=0A+=09=09=20=20if=20(CHAR_BYTE8_HEAD_P=20(p[1]))=0A+=09=09=20= =20=20=20fastmap[CHAR_TO_BYTE8=20(STRING_CHAR=20(p=20+=201))]=20=3D=201;=0A= +=09=09}=0A+=09=20=20=20=20=20=20else=0A=20=09=09{=0A=20=09=09=20=20/*=20= For=20the=20case=20of=20matching=20this=20unibyte=20regex=0A=20=09=09=20=20= =20=20=20against=20multibyte,=20we=20must=20set=20a=20leading=20code=20= of=0A@@=20-2886,11=20+2894,18=20@@=20analyze_first=20(re_char=20*p,=20= re_char=20*pend,=20char=20*fastmap,=20bool=20multibyte)=0A=20=09case=20= charset:=0A=20=09=20=20if=20(!fastmap)=20break;=0A=20=09=20=20not=20=3D=20= (re_opcode_t)=20*(p=20-=201)=20=3D=3D=20charset_not;=0A-=09=20=20for=20= (j=20=3D=20CHARSET_BITMAP_SIZE=20(&p[-1])=20*=20BYTEWIDTH=20-=201,=20= p++;=0A-=09=20=20=20=20=20=20=20j=20>=3D=200;=20j--)=0A+=09=20=20nbits=20= =3D=20CHARSET_BITMAP_SIZE=20(&p[-1])=20*=20BYTEWIDTH;=0A+=09=20=20p++;=0A= +=09=20=20for=20(j=20=3D=200;=20j=20<=20nbits;=20j++)=0A=20=09=20=20=20=20= if=20(!!(p[j=20/=20BYTEWIDTH]=20&=20(1=20<<=20(j=20%=20BYTEWIDTH)))=20^=20= not)=0A=20=09=20=20=20=20=20=20fastmap[j]=20=3D=201;=0A=20=0A+=09=20=20= /*=20To=20match=20raw=20bytes=20(in=20the=2080..ff=20range)=20against=20= multibyte=0A+=09=20=20=20=20=20strings,=20add=20their=20leading=20bytes=20= to=20the=20fastmap.=20=20*/=0A+=09=20=20for=20(j=20=3D=200x80;=20j=20<=20= nbits;=20j++)=0A+=09=20=20=20=20if=20(!!(p[j=20/=20BYTEWIDTH]=20&=20(1=20= <<=20(j=20%=20BYTEWIDTH)))=20^=20not)=0A+=09=20=20=20=20=20=20= fastmap[CHAR_LEADING_CODE=20(BYTE8_TO_CHAR=20(j))]=20=3D=201;=0A+=0A=20=09= =20=20if=20(/*=20Any=20leading=20code=20can=20possibly=20start=20a=20= character=0A=20=09=09=20which=20doesn't=20match=20the=20specified=20set=20= of=20characters.=20=20*/=0A=20=09=20=20=20=20=20=20not=0A@@=20-4251,8=20= +4266,9=20@@=20re_match_2_internal=20(struct=20re_pattern_buffer=20= *bufp,=0A=20=09=09=20=20}=0A=20=09=09p=20+=3D=20pat_charlen;=0A=20=09=09= d++;=0A+=09=09mcnt=20-=3D=20pat_charlen;=0A=20=09=20=20=20=20=20=20}=0A-=09= =20=20=20=20while=20(--mcnt);=0A+=09=20=20=20=20while=20(mcnt=20>=200);=0A= =20=0A=20=09=20=20break;=0A=20=0Adiff=20--git=20= a/test/src/regex-emacs-tests.el=20b/test/src/regex-emacs-tests.el=0A= index=200ae50c94d4..50ed3e870a=20100644=0A---=20= a/test/src/regex-emacs-tests.el=0A+++=20b/test/src/regex-emacs-tests.el=0A= @@=20-683,4=20+683,124=20@@=20regex-tests-TESTS=0A=20=20=20(should-not=20= (string-match=20"\\`x\\{65535\\}"=20(make-string=2065534=20?x)))=0A=20=20= =20(should-error=20(string-match=20"\\`x\\{65536\\}"=20"X")=20:type=20= 'invalid-regexp))=0A=20=0A+(ert-deftest=20regexp-unibyte-unibyte=20()=0A= +=20=20"Test=20matching=20a=20unibyte=20regexp=20against=20a=20unibyte=20= string."=0A+=20=20;;=20Sanity=20check=0A+=20=20(should-not=20= (multibyte-string-p=20"ab"))=0A+=20=20(should-not=20(multibyte-string-p=20= "\xff"))=0A+=20=20;;=20ASCII=0A+=20=20(should=20(string-match=20"a[b]"=20= "ab"))=0A+=20=20;;=20Raw=0A+=20=20(should=20(string-match=20"\xf1"=20= "\xf1"))=0A+=20=20(should-not=20(string-match=20"\xf1"=20"\xc1\xb1"))=0A= +=20=20;;=20Raw,=20char=20alt=0A+=20=20(should=20(string-match=20= "[\xf1]"=20"\xf1"))=0A+=20=20(should-not=20(string-match=20"[\xf1]"=20= "\xc1\xb1"))=0A+=20=20;;=20Raw=20range=0A+=20=20(should=20(string-match=20= "[\x82-\xd3]"=20"\xbb"))=0A+=20=20(should-not=20(string-match=20= "[\x82-\xd3]"=20"a"))=0A+=20=20(should-not=20(string-match=20= "[\x82-\xd3]"=20"\x81"))=0A+=20=20(should-not=20(string-match=20= "[\x82-\xd3]"=20"\xd4"))=0A+=20=20;;=20ASCII-raw=20range=0A+=20=20= (should=20(string-match=20"[f-\xd3]"=20"q"))=0A+=20=20(should=20= (string-match=20"[f-\xd3]"=20"\xbb"))=0A+=20=20(should-not=20= (string-match=20"[f-\xd3]"=20"e"))=0A+=20=20(should-not=20(string-match=20= "[f-\xd3]"=20"\xd4")))=0A+=0A+(ert-deftest=20regexp-multibyte-multibyte=20= ()=0A+=20=20"Test=20matching=20a=20multibyte=20regexp=20against=20a=20= multibyte=20string."=0A+=20=20;;=20Sanity=20check=0A+=20=20(should=20= (multibyte-string-p=20"=C3=A5=C3=BC"))=0A+=20=20;;=20ASCII=0A+=20=20= (should=20(string-match=20(string-to-multibyte=20"a[b]")=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (string-to-multibyte=20"ab")))=0A+=20=20;;=20Unicode=0A+=20=20(should=20= (string-match=20"=C3=A5[=C3=BC]z"=20"=C3=A5=C3=BCz"))=0A+=20=20= (should-not=20(string-match=20"=C3=BC"=20(string-to-multibyte=20= "\xc3\xbc")))=0A+=20=20;;=20Raw=0A+=20=20(should=20(string-match=20= (string-to-multibyte=20"\xf1")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(string-to-multibyte=20"\xf1")))=0A+=20=20= (should-not=20(string-match=20(string-to-multibyte=20"\xf1")=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (string-to-multibyte=20"\xc1\xb1")))=0A+=20=20(should-not=20= (string-match=20(string-to-multibyte=20"\xc1\xb1")=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (string-to-multibyte=20"\xf1")))=0A+=20=20;;=20Raw,=20char=20alt=0A+=20=20= (should=20(string-match=20(string-to-multibyte=20"[\xf1]")=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (string-to-multibyte=20"\xf1")))=0A+=20=20;;=20Raw=20range=0A+=20=20= (should=20(string-match=20(string-to-multibyte=20"[\x82-\xd3]")=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (string-to-multibyte=20"\xbb")))=0A+=20=20(should-not=20(string-match=20= (string-to-multibyte=20"[\x82-\xd3]")=20"a"))=0A+=20=20(should-not=20= (string-match=20(string-to-multibyte=20"[\x82-\xd3]")=20"=C3=85"))=0A+=20= =20(should-not=20(string-match=20(string-to-multibyte=20"[\x82-\xd3]")=20= "=C3=BC"))=0A+=20=20(should-not=20(string-match=20(string-to-multibyte=20= "[\x82-\xd3]")=20"\x81"))=0A+=20=20(should-not=20(string-match=20= (string-to-multibyte=20"[\x82-\xd3]")=20"\xd4"))=0A+=20=20;;=20ASCII-raw=20= range:=20should=20exclude=20U+0100..U+10FFFF=0A+=20=20(should=20= (string-match=20(string-to-multibyte=20"[f-\xd3]")=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(string-to-multibyte=20= "q")))=0A+=20=20(should=20(string-match=20(string-to-multibyte=20= "[f-\xd3]")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(string-to-multibyte=20"\xbb")))=0A+=20=20(should-not=20= (string-match=20(string-to-multibyte=20"[f-\xd3]")=20"e"))=0A+=20=20= (should-not=20(string-match=20(string-to-multibyte=20"[f-\xd3]")=20= "=C3=85"))=0A+=20=20(should-not=20(string-match=20(string-to-multibyte=20= "[f-\xd3]")=20"=C3=BC"))=0A+=20=20(should-not=20(string-match=20= (string-to-multibyte=20"[f-\xd3]")=20"\xd4"))=0A+=20=20;;=20Unicode-raw=20= range:=20should=20be=20empty=0A+=20=20(should-not=20(string-match=20= "[=C3=A5-\xd3]"=20"=C3=A5"))=0A+=20=20(should-not=20(string-match=20= "[=C3=A5-\xd3]"=20(string-to-multibyte=20"\xd3")))=0A+=20=20(should-not=20= (string-match=20"[=C3=A5-\xd3]"=20(string-to-multibyte=20"\xbb")))=0A+=20= =20(should-not=20(string-match=20"[=C3=A5-\xd3]"=20"=C3=BC"))=0A+=20=20= ;;=20No=20equivalence=20between=20raw=20bytes=20and=20latin-1=0A+=20=20= (should-not=20(string-match=20"=C3=A5"=20(string-to-multibyte=20= "\xe5")))=0A+=20=20(should-not=20(string-match=20"[=C3=A5]"=20= (string-to-multibyte=20"\xe5")))=0A+=20=20(should-not=20(string-match=20= "\xe5"=20"=C3=A5"))=0A+=20=20(should-not=20(string-match=20"[\xe5]"=20= "=C3=A5")))=0A+=0A+(ert-deftest=20regexp-unibyte-multibyte=20()=0A+=20=20= "Test=20matching=20a=20unibyte=20regexp=20against=20a=20multibyte=20= string."=0A+=20=20;;=20ASCII=0A+=20=20(should=20(string-match=20"a[b]"=20= (string-to-multibyte=20"ab")))=0A+=20=20;;=20Unicode=0A+=20=20(should=20= (string-match=20"a.[^b]c"=20(string-to-multibyte=20"a=C3=A5=C3=BCc")))=0A= +=20=20;;=20Raw=0A+=20=20(should=20(string-match=20"\xf1"=20= (string-to-multibyte=20"\xf1")))=0A+=20=20(should-not=20(string-match=20= "\xc1\xb1"=20(string-to-multibyte=20"\xf1")))=0A+=20=20;;=20Raw,=20char=20= alt=0A+=20=20(should=20(string-match=20"[\xf1]"=20(string-to-multibyte=20= "\xf1")))=0A+=20=20(should-not=20(string-match=20"[\xc1][\xb1]"=20= (string-to-multibyte=20"\xf1")))=0A+=20=20;;=20ASCII-raw=20range:=20= should=20exclude=20U+0100..U+10FFFF=0A+=20=20(should=20(string-match=20= "[f-\xd3]"=20(string-to-multibyte=20"q")))=0A+=20=20(should=20= (string-match=20"[f-\xd3]"=20(string-to-multibyte=20"\xbb")))=0A+=20=20= (should-not=20(string-match=20"[f-\xd3]"=20"e"))=0A+=20=20(should-not=20= (string-match=20"[f-\xd3]"=20"=C3=85"))=0A+=20=20(should-not=20= (string-match=20"[f-\xd3]"=20"=C3=BC"))=0A+=20=20(should-not=20= (string-match=20"[f-\xd3]"=20"\xd4"))=0A+=20=20;;=20No=20equivalence=20= between=20raw=20bytes=20and=20latin-1=0A+=20=20(should-not=20= (string-match=20"\xe5"=20"=C3=A5"))=0A+=20=20(should-not=20(string-match=20= "[\xe5]"=20"=C3=A5")))=0A+=0A+(ert-deftest=20regexp-multibyte-unibyte=20= ()=0A+=20=20"Test=20matching=20a=20multibyte=20regexp=20against=20a=20= unibyte=20string."=0A+=20=20;;=20ASCII=0A+=20=20(should=20(string-match=20= (string-to-multibyte=20"a[b]")=20"ab"))=0A+=20=20;;=20Unicode=0A+=20=20= (should=20(string-match=20"a[^=C3=BC]c"=20"abc"))=0A+=20=20(should-not=20= (string-match=20"=C3=BC"=20"\xc3\xbc"))=0A+=20=20;;=20Raw=0A+=20=20= (should=20(string-match=20(string-to-multibyte=20"\xf1")=20"\xf1"))=0A+=20= =20(should-not=20(string-match=20(string-to-multibyte=20"\xf1")=20= "\xc1\xb1"))=0A+=20=20;;=20Raw,=20char=20alt=0A+=20=20(should=20= (string-match=20(string-to-multibyte=20"[\xf1]")=20"\xf1"))=0A+=20=20= (should-not=20(string-match=20(string-to-multibyte=20"[\xf1]")=20= "\xc1\xb1"))=0A+=20=20;;=20ASCII-raw=20range:=20should=20exclude=20= U+0100..U+10FFFF=0A+=20=20(should=20(string-match=20(string-to-multibyte=20= "[f-\xd3]")=20"q"))=0A+=20=20(should=20(string-match=20= (string-to-multibyte=20"[f-\xd3]")=20"\xbb"))=0A+=20=20(should-not=20= (string-match=20(string-to-multibyte=20"[f-\xd3]")=20"e"))=0A+=20=20= (should-not=20(string-match=20(string-to-multibyte=20"[f-\xd3]")=20= "\xd4"))=0A+=20=20;;=20Unicode-raw=20range:=20should=20be=20empty=0A+=20=20= (should-not=20(string-match=20"[=C3=A5-\xd3]"=20"\xd3"))=0A+=20=20= (should-not=20(string-match=20"[=C3=A5-\xd3]"=20"\xbb"))=0A+=20=20;;=20= No=20equivalence=20between=20raw=20bytes=20and=20latin-1=0A+=20=20= (should-not=20(string-match=20"=C3=A5"=20"\xe5"))=0A+=20=20(should-not=20= (string-match=20"[=C3=A5]"=20"\xe5")))=0A+=0A=20;;;=20= regex-emacs-tests.el=20ends=20here=0A--=20=0A2.20.1=20(Apple=20Git-117)=0A= =0A= --Apple-Mail=_B17C82BC-7896-44D6-95E5-730AD2093CAA--