From: Joseph Jones Date: 2015-12-17T21:13:16-07:00 Subject: [ruby-core:72338] [Ruby trunk - Bug #10097] Case-insensitive Regexp matching for Windows-1252 not working for ŠšŽžŒœÿŸ --567387dc_1fbfe8e0_16c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Joseph Jones liked your message with Boxer. On December 11, 2015 at 01:04= :08 MST, duerst=40it.aoyama.ac.jp wrote:Issue =2310097 has been updated b= y Martin D=C3=BCrst.Nobuyoshi Nakada wrote:> Is this correct=3F> https://= github.com/nobu/ruby/compare/windows-1252Sorry for the very slow response= . Please commit. Thanks=21----------------------------------------Bug =23= 10097: Case-insensitive Regexp matching for Windows-1252 not working for = =C5=A0=C5=A1=C5=BD=C5=BE=C5=92=C5=93=C3=BF=C5=B8https://bugs.ruby-lang.or= g/issues/10097=23change-55458* Author: Martin D=C3=BCrst* Status: Open* P= riority: Normal* Assignee: * ruby -v: 1.9.3p545* Backport: 2.0.0: UNKNOWN= , 2.1: UNKNOWN----------------------------------------By chance I had a l= ook at enc/iso=5F8859=5F1.c and found=7E=7E=7ECENC=5FREPLICATE(=22Windows= -1252=22, =22ISO-8859-1=22)=7E=7E=7Eon line 288. But this does not work f= or case folding:=7E=7E=7Eruby=23 http://en.wikipedia.org/wiki/Windows-125= 2s1 =3D =22=5Cu0160=22.encode 'windows-1252' =23 '=C5=A0'r1 =3D Regexp.ne= w(=22=5Cu0161=22.encode('windows-1252'), Regexp::IGNORECASE) =23 /=C5=A1/= is1 =3D=7E r1 =23 =3D> nils2 =3D =22=5Cu0178=22.encode 'windows-1252' =23= '=C5=B8'r2 =3D Regexp.new(=22=5Cu00=46=46=22.encode('windows-1252'), Reg= exp::IGNORECASE) =23 /=C3=BF/is2 =3D=7E r2 =23 =3D> nils3 =3D =22=5Cu00C0= =22.encode 'windows-1252' =23 '=C3=80'r3 =3D Regexp.new(=22=5Cu00E0=22.en= code('windows-1252'), Regexp::IGNORECASE) =23 /=C3=A0/is3 =3D=7E r3 =23 =3D= > 0=7E=7E=7ESo case-insensitive matching works when both characters are i= n iso-8859-1, but not when one (=C3=BF=C5=B8) or both (=C5=A0=C5=A1=C5=BD= =C5=BE=C5=92=C5=93) characters are not in iso-8859-1.-- https://bugs.ruby= -lang.org/ --567387dc_1fbfe8e0_16c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Joseph Jones liked your message with Boxer.


= On December 11, 2015 at 01:04:08 MST, duerst=40it.aoyama.ac.jp wrote:
Issue =2310097 has been u= pdated by Martin D=C3=BCrst.


Nobuyoshi Nakada wrote:
> Is this correct=3F
> https://github.com/nobu/ruby/compare/window= s-1252

Sorry for the very slow response. Please commit. Thanks= =21

----------------------------------------
Bug =2310097= : Case-insensitive Regexp matching for Windows-1252 not working for =C5=A0= =C5=A1=C5=BD=C5=BE=C5=92=C5=93=C3=BF=C5=B8
https://bugs.ruby-lang.or= g/issues/10097=23change-55458

* Author: Martin D=C3=BCrst
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v:= 1.9.3p545
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
-----------= -----------------------------
By chance I had a look at enc/iso=5F88= 59=5F1.c and found

=7E=7E=7EC
ENC=5FREPLICATE(=22Windows-= 1252=22, =22ISO-8859-1=22)
=7E=7E=7E
on line 288. But this does= not work for case folding:

=7E=7E=7Eruby
=23 http://en.w= ikipedia.org/wiki/Windows-1252
s1 =3D =22=5Cu0160=22.encode 'windows= -1252' =23 '=C5=A0'
r1 =3D Regexp.new(=22=5Cu0161=22.encode('windows= -1252'), Regexp::IGNORECASE) =23 /=C5=A1/i
s1 =3D=7E r1
=23 = =3D> nil
s2 =3D =22=5Cu0178=22.encode 'windows-1252' =23 '=C5=B8'r2 =3D Regexp.new(=22=5Cu00=46=46=22.encode('windows-1252'), Regexp::I= GNORECASE) =23 /=C3=BF/i
s2 =3D=7E r2
=23 =3D> nil
s3 =3D= =22=5Cu00C0=22.encode 'windows-1252' =23 '=C3=80'
r3 =3D Regexp.new= (=22=5Cu00E0=22.encode('windows-1252'), Regexp::IGNORECASE) =23 /=C3=A0/i=
s3 =3D=7E r3
=23 =3D> 0
=7E=7E=7E

So case-i= nsensitive matching works when both characters are in iso-8859-1, but not= when one (=C3=BF=C5=B8) or both (=C5=A0=C5=A1=C5=BD=C5=BE=C5=92=C5=93) c= haracters are not in iso-8859-1.



--
https://= bugs.ruby-lang.org/
--567387dc_1fbfe8e0_16c--