> -----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 
> 
> nick@bactrian 1006$ ./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
> nick@bactrian 1007$ 
> 
> 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