perl5 porters, finally I added a testsuite to the proposed patch. According to the report by rajarshi das, this patch should fix a problem on EBCDIC platform.
- see there for his report: http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00112.html Regards, SADAHIRO Tomoyuki patch against change 25712: diff -ur [EMAIL PROTECTED]/lib/utf8.t perl/lib/utf8.t --- [EMAIL PROTECTED]/lib/utf8.t Thu Jan 13 23:20:06 2005 +++ perl/lib/utf8.t Sat Oct 08 13:59:09 2005 @@ -37,7 +37,7 @@ # # -plan tests => 146; +plan tests => 150; { # bug id 20001009.001 @@ -430,4 +430,12 @@ fresh_perl_like ('use utf8; utf8::moo()', qr/Undefined subroutine utf8::moo/, {stderr=>1}, "Check Carp is loaded for AUTOLOADing errors") +} + +{ + # failure of is_utf8_char() without NATIVE_TO_UTF on EBCDIC (0260..027F) + ok(utf8::valid(chr(0x250)), "0x250"); + ok(utf8::valid(chr(0x260)), "0x260"); + ok(utf8::valid(chr(0x270)), "0x270"); + ok(utf8::valid(chr(0x280)), "0x280"); } diff -ur [EMAIL PROTECTED]/utf8.c perl/utf8.c --- [EMAIL PROTECTED]/utf8.c Thu Oct 06 01:03:27 2005 +++ perl/utf8.c Sat Oct 08 14:03:30 2005 @@ -209,6 +209,9 @@ slen = len - 1; s++; +#ifdef EBCDIC + u = NATIVE_TO_UTF(u); +#endif u &= UTF_START_MASK(len); uv = u; ouv = uv; diff -ur [EMAIL PROTECTED]/utf8.h perl/utf8.h --- [EMAIL PROTECTED]/utf8.h Wed Jun 08 00:04:28 2005 +++ perl/utf8.h Sun Oct 02 15:47:26 2005 @@ -258,6 +258,9 @@ #endif #define SHARP_S_SKIP 2 +#ifdef EBCDIC +/* IS_UTF8_CHAR() is not ported to EBCDIC */ +#else #define IS_UTF8_CHAR_1(p) \ ((p)[0] <= 0x7F) #define IS_UTF8_CHAR_2(p) \ @@ -329,3 +332,4 @@ #define IS_UTF8_CHAR_FAST(n) ((n) <= 4) +#endif /* IS_UTF8_CHAR() for UTF-8 */
