One example more, toke from op/concat.t:

../perl -Ilib -MDevel::Peek -e
'$_=$dx="\x{10f2}";Dump($dx);s/($dx)/$dx$1/;Dump($_);'

result is:

SV = PV(0x17569d4) at 0x179f448
  REFCNT = 1
  FLAGS = (POK,pPOK,UTF8)
  PV = 0x17ccbd8 "[\110\131"\0 [UTF8 "\x{10f2}"]
  CUR = 3
  LEN = 4
Malformed UTF-8 character (unexpected continuation byte 0x48, with no
preceding
start byte) in regexp compilation at -e line 1.
Malformed UTF-8 character (unexpected continuation byte 0x59, with no
preceding
start byte) in regexp compilation at -e line 1.
Unmatched [ in regex; marked by <-- HERE in m/([ <-- HERE çß)/ at -e line 1.


Same commands with the patched perl, the result is:

SV = PV(0x17569d4) at 0x179f448
  REFCNT = 1
  FLAGS = (POK,pPOK,UTF8)
  PV = 0x17ccbd8 "\171\110\131"\0 [UTF8 "\x{10f2}"]
  CUR = 3
  LEN = 4
SV = PVMG(0x17c7368) at 0x17566a0
  REFCNT = 1
  FLAGS = (SMG,POK,pPOK,UTF8)
  IV = 0
  NV = 0
  PV = 0x17cce48 "\171\110\131\171\110\131"\0 [UTF8 "\x{10f2}\x{10f2}"]
  CUR = 6
  LEN = 7
  MAGIC = 0x17a1878
    MG_VIRTUAL = &PL_vtbl_mglob
    MG_TYPE = PERL_MAGIC_regex_global(g)
    MG_LEN = -1

And that's OK for me !

Cheers,
Ignasi Roca.


> -----Original Message-----
> From: Roca Carrio, Ignasi (PO EP) 
> 
> 
> > -----Original Message-----
> > From: Nick Ing-Simmons [mailto:[EMAIL PROTECTED]]
> > 
> > Roca Carrio <[EMAIL PROTECTED]> writes:
> > >> 
> > >> Ignasi, could you show a minimal example of a "Malformed" test?
> > >> And what does for example this show?
> > >> 
> > >> ./perl -Ilib -MDevel::Peek -e 'Dump(chr(256))'
> > >>
> > >
> > >Tried
> > >../perl -Ilib -MDevel::Peek -e 'Dump(chr(256))'
> > >the result without problems is:
> > >
> > >SV = PV(0x1756a10) at 0x179f42c
> > >  REFCNT = 1
> > >  FLAGS = (POK,READONLY,pPOK,UTF8)
> > >  PV = 0x17a1b18 "\214\101"\0 [UTF8 "\x{100}"]
> > >  CUR = 2
> > >  LEN = 3
> > >
> > >Tried
> > >../perl -Ilib -MDevel::Peek -e 'Dump(~(chr(0xEEE).chr(0x6A)))'
> > >toke from t/op/bop.t, the result is:
> > 
> > Running that on ASCII/Linux gives 
> > 
> > $ ./perl -Ilib -MDevel::Peek -e 'Dump(~(chr(0xEEE).chr(0x6A)))'
> > SV = PV(0x8160498) at 0x8137560
> >   REFCNT = 1
> >   FLAGS = (POK,READONLY,pPOK,UTF8)
> >   PV = 0x8153e98 
> > "\376\203\277\277\277\204\221\376\203\277\277\277\276\225"\0 
> > [UTF8 "\x{fffff111}\x{ffffff95}"]
> >   CUR = 14
> >   LEN = 15
> > $ 
> > 
> > There is a serious potential snag here UTF-EBCDIC only 
> > defines encoding 
> > up to 2**31 so we cannot really "do" ~  if ~ operates on a 
> 32-bit UV.
> > 
> > Is that the issue you are trying to fix ?
> 
> Perl's Harness-Test on EBCDIC/POSIX-BC fails on several tests, op/bop.t is
> only one of them. Other test that fails and corrected with the patch are
> op/concat.t, op/crypt.t, uni/fold.t ...
> 
> Anyway I can see that your result on ASCII/Linux supplies UTF8 code as it
is
> supplied on EBCDIC/POSIX-BC with my patch [UTF8
"\x{fffff111}\x{ffffff95}"],
> that indicates that my patch is is the right way.
> 
> What I understood on the Unicode Technical Report #16 is that the
conversion
> table is taken to maintain consistency with the codepage 1047 for the
> variant characters, but it ignores remaining codepages. So I added the
> translation table to be used on POSIX-BC platforms which corrects the
> differences between DF04_1 and 1047. With this table the 'Malformed UTF-8
> character' error messages disappears and of cause produced UTF-EBCDIC
> differs from the one produced on VMS/OS, but this kind of code is thought
> only to be used inside homogeneous EBCDIC systems and networks.
> 
> > 
> > >
> > >Malformed UTF-8 character (unexpected continuation byte 0x6a, with no
> > >preceding
> > >start byte) in 1's complement (~) at -e line 1.
> > >Malformed UTF-8 character (unexpected continuation byte 0x6a, with no
> > >preceding
> > >start byte) in 1's complement (~) at -e line 1.
> > >SV = PV(0x17b69c8) at 0x17567f0
> > >  REFCNT = 1
> > >  FLAGS = (POK,READONLY,pPOK,UTF8)
> > >  PV = 0x1793e38
> > >"\376\163\163\163\160\111\130\376\163\163\163\163\163\163"\0 [UTF8
> > >"\x{7ffff111}\x{7fffffff}"]
> > >  CUR = 14
> > >  LEN = 15
> > >
> > >Tried with my patch:
> > >../perl.patched -Ilib -MDevel::Peek -e 
> > 'Dump(~(chr(0xEEE).chr(0x6A)))'
> > >the result is:
> > >
> > >SV = PV(0x17b69f8) at 0x17567f0
> > >  REFCNT = 1
> > >  FLAGS = (POK,READONLY,pPOK,UTF8)
> > >  PV = 0x1793e48
> > >"\376\163\163\163\160\111\130\376\163\163\163\163\160\144"\0 [UTF8
> > >"\x{7ffff111}\x{7fffff95}"]
> > >  CUR = 14
> > >  LEN = 15
> > >
> > >
> > >-- Ignasi Roca.
> > -- 
> > Nick Ing-Simmons
> > http://www.ni-s.u-net.com/
> > 
> 

Reply via email to