Hi Sadahiro
I have individually run these two test cases.
a)$c = ($a = "\x89\x8a\x8b\x8c\x8d\x8f\x90\x91") =~ tr/\x{100}\x89-\x91/X/;
is($c, 8);
is($a, "XXXXXXXX");
b)$c = ($a = "\xc9\xca\xcb\xcc\xcd\xcf\xd0\xd1") =~ tr/\x{1000}\xc9-\xd1/X/;
is($c, 8);
is($a, "XXXXXXXX");
The verbose output for both are displayed individually as follows
a) For First Test Case
----------------------------------------------------------------------------------------------------------------
SWASHNEW utf8 # comment
0100 0058
0069 XXXX
00c6 XXXX
00c7 XXXX
00c8 XXXX
00c9 XXXX
00ca XXXX
00cb XXXX
00cc XXXX
006a XXXX
8 89
# => comment
CLASS = utf8, TYPE => , BITS => 8, NONE => 89
EXTRAS =>
# comment
LIST =>
0069 005a
006a 005a
00c6 005a
00c7 005a
00c8 005a
00c9 005a
00ca 005a
00cb 005a
00cc 005a
0100 0058
SWASHGET utf8=HASH(0x20f5c1f4) 0 160 [/8/89]
105 => 90
105 => 90
106 => 90
CELLS 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89
89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89
89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89
89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89
89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 90 90 89 89 89 89 89 89
89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89
89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89
89
SWASHGET utf8=HASH(0x20f5c1f4) 160 32 [/8/89]
CELLS 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89
89 89 89 89 89 89 89 89 89 89 89
SWASHGET utf8=HASH(0x20f5c1f4) 224 32 [/8/89]
CELLS 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89
89 89 89 89 89 89 89 89 89 89 89
# Failed at t/op/tr_new.t line 32
# got '2'
# expected '8'
# Failed at t/op/tr_new.t line 33
# got 'X–¤ó¯ÅŒX'
# expected 'XXXXXXXX'
1..2
105 105 90
105 105 90
106 106 90
198 198 90
198 198 90
256 256 88
not ok 1
not ok 2
--------------------------------------------------------------------------------------------
b) For Second Test case
SWASHNEW utf8 # comment
1000 0058
0049 XXXX
00e8 XXXX
00e9 XXXX
00ea XXXX
00eb XXXX
00ec XXXX
00ed XXXX
007d XXXX
004a XXXX
8 89
# => comment
CLASS = utf8, TYPE => , BITS => 8, NONE => 89
EXTRAS =>
# comment
LIST =>
0049 005a
004a 005a
007d 005a
00e8 005a
00e9 005a
00ea 005a
00eb 005a
00ec 005a
00ed 005a
1000 0058
SWASHGET utf8=HASH(0x20f5c1f4) 0 160 [/8/89]
73 => 90
73 => 90
74 => 90
125 => 90
CELLS 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89
89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89
89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89
89 89 89 89 89 89 90 90 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89
89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89
89 89 89 89 89 89 89 89 89 89 89 89 90 89 89 89 89 89 89 89 89 89 89
89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89
89
SWASHGET utf8=HASH(0x20f5c1f4) 160 32 [/8/89]
CELLS 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89
89 89 89 89 89 89 89 89 89 89 89
SWASHGET utf8=HASH(0x20f5c1f4) 224 32 [/8/89]
232 => 90
233 => 90
234 => 90
235 => 90
236 => 90
237 => 90
CELLS 89 89 89 89 89 89 89 89 90 90 90 90 90 90 89 89 89 89 89 89 89
89 89 89 89 89 89 89 89 89 89 89
# Failed at t/op/tr_new.t line 36
# got '3'
# expected '8'
# Failed at t/op/tr_new.t line 37
# got 'XËʾèíXX'
# expected 'XXXXXXXX'
1..2
73 73 90
73 73 90
74 74 90
125 125 90
232 232 90
232 232 90
232 232 90
233 233 90
234 234 90
235 235 90
236 236 90
237 237 90
4096 4096 88
not ok 1
not ok 2
---------------------------------------------------------------------------------------------------------
>Thus I think these outputs reflect misusing of NATIVE_TO_UTF().
I reconfirmed with the utfebcdic.h that the character ranges are
getting expanded as expected.
a)Is the Verbose output correct as expected?
b)Do you think that the NATIVE_TO_UTF() is misbehaving in which case
it would not have expanded the character ranges using PL_e2utf?
regards
Sastry
On 9/28/05, SADAHIRO Tomoyuki <[EMAIL PROTECTED]> wrote:
>
> On Wed, 28 Sep 2005 11:58:41 +0530, Sastry <[EMAIL PROTECTED]> wrote
>
> > Hi Sadahiro
> > I was preoccupied with the other stuff. So i could not
> > respond you immediately!
> > For the previous four tests that were failing, I had collected the
> > verbose ouput and it looks like this. I had also made changes to
> > NATIVE_TO_UTF from NATIVE_TO_ASCII
> > -----------------------------------------------------------------------------------------
> >
> > SWASHNEW utf8 # comment
> > 0100 0058
> > 0069 XXXX
> > 00c6 XXXX
> > 00c7 XXXX
> > 00c8 XXXX
> > 00c9 XXXX
> > 00ca XXXX
> > 00cb XXXX
> > 00cc XXXX
> > 006a XXXX
>
> To me, this output is expectable if it comes from /\x{0100}\x89-\x91/
> (beginning with 256 in decimal) with NATIVE_TO_UTF() misused;
> but not from \x{1000}\x89-\x91 (beginning with 4096 in decimal)
>
> I think (0x69,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0x6a) should come
> from PL_e2utf[] in the range of 0x89 to 0x91.
>
> -- see utfebcdic.h for PL_e2utf[], which is used in NATIVE_TO_UTF(),
>
> #define NATIVE_TO_UTF(ch) PL_e2utf[(U8)(ch)]
>
> > SWASHNEW utf8 # comment
> > 1000 0058
> > 0049 XXXX
> > 00e8 XXXX
> > 00e9 XXXX
> > 00ea XXXX
> > 00eb XXXX
> > 00ec XXXX
> > 00ed XXXX
> > 007d XXXX
> > 004a XXXX
>
> To me, this output is expectable if it come from /\x{1000}\xc9-\xd1/
> (beginning with 4096 in decimal) with NATIVE_TO_UTF() misused.
>
> I think (0x49,0xe8,0xe9,0xea,0xeb,0xec,0xed,0x7d,0x4a) should come
> from PL_e2utf[] in the range of 0xc9 to 0xd1.
>
> Thus I think these outputs reflect misusing of NATIVE_TO_UTF().
>
> Regards,
> SADAHIRO Tomoyuki
>
>
>