Johan Vromans <[EMAIL PROTECTED]> writes:
>[Quoting Nick Ing-Simmons, on April 30 2002, 10:30, in "Re: Smoke 16267 linu"]
>> >.../ext/PerlIO/t/fallback....FAILED test 6
>> What does the fallback test show when run long-hand ?
>
>1..8
>ok 1 - opened iso-8859-1 file
>ok 2 - perlqq escapes
>ok 3 - opened iso-8859-1 file
>ok 4 - HTML escapes
>ok 5 - Opened as ASCII
># 5c
>not ok 6 - Escaped non-mapped char
># Failed at ../ext/PerlIO/t/fallback.t line 47
># got '\\xBFFFBA74000000A30.02
># '
># expected '\\xA30.02
Thanks - looks like it is Encode.xs that is mis printf'ing
the value of the "octet":
This:
Perl_croak(
aTHX_ "%s \"\\x%02" UVXf
"\" does not map to Unicode (%d)",
enc->name[0], (U8) s[slen], code);
We don't mean (U8) but (UV), but even the (U8) is missing
in the one that is failing:
SV* perlqq =
sv_2mortal(newSVpvf("\\x%02" UVXf, s[slen]));
(We have a U8 *s)
I guess we are lucky it does segfault trying to read a mis-aligned UV.
># '
>ok 7 - Opened as ASCII
># fffd
>ok 8 - Unicode replacement char
>
>-- Johan
--
Nick Ing-Simmons
http://www.ni-s.u-net.com/