Daniel P. Berrange [Fri, 3 Aug 2001 11:39:33 +0000 (12:39 +0100)]
Message-ID: <
20010803113932.A19318@berrange.com>
(the mg_length() fix)
p4raw-id: //depot/perl@11572
}
}
- (void)SvPV(sv, len);
+ if (DO_UTF8(sv))
+ {
+ U8 *s = (U8*)SvPV(sv, len);
+ len = Perl_utf8_length(aTHX_ s, s + len);
+ }
+ else
+ (void)SvPV(sv, len);
return len;
}
print "ok 13\n";
$test++;
}
+
+# Now for Unicode with magical vtbls
+
+{
+ require Tie::Scalar;
+ my $a;
+ tie $a, 'Tie::StdScalar'; # makes $a magical
+ $a = "\x{263A}";
+
+ print "not " unless length($a) == 1;
+ print "ok 14\n";
+ $test++;
+
+ use bytes;
+ print "not " unless length($a) == 3;
+ print "ok 15\n";
+ $test++;
+}