}
$| = 1;
-print "1..10\n";
+print "1..12\n";
use charnames ':full';
print "ok 9\n";
print "not " unless sprintf("%vx", "\N{WHITE SMILING FACE}") eq "263a";
print "ok 10\n";
+ print "not " unless sprintf("%vx", "\xFF\N{WHITE SMILING FACE}") eq "ff.263a";
+ print "ok 11\n";
+ print "not " unless sprintf("%vx", "\x{ff}\N{WHITE SMILING FACE}") eq "ff.263a";
+ print "ok 12\n";
}
res = new_constant( Nullch, 0, "charnames",
res, Nullsv, "\\N{...}" );
str = SvPV(res,len);
- if (len > 1)
+ if (!has_utf && SvUTF8(res)) {
+ char *ostart = SvPVX(sv);
+ SvCUR_set(sv, d - ostart);
+ SvPOK_on(sv);
+ sv_utf8_upgrade(sv);
+ d = SvPVX(sv) + SvCUR(sv);
has_utf = TRUE;
+ }
if (len > e - s + 4) {
char *odest = SvPVX(sv);