p4raw-id: //depot/perl@3136
e = strchr(PL_regcomp_parse++, '}');
if (!e)
FAIL("Missing right brace on \\x{}");
- value = scan_hex(PL_regcomp_parse + 1, e - PL_regcomp_parse, &numlen);
+ value = scan_hex(PL_regcomp_parse, e - PL_regcomp_parse, &numlen);
PL_regcomp_parse = e + 1;
}
else {
--- /dev/null
+#!./perl
+
+BEGIN {
+ chdir 't' if -d 't';
+ unshift @INC, '../lib';
+ $ENV{PERL5LIB} = '../lib';
+}
+
+print "1..3\n";
+
+my $test = 1;
+
+sub ok {
+ my ($got,$expect) = @_;
+ print "# expected [$expect], got [$got]\nnot " if $got ne $expect;
+ print "ok $test\n";
+}
+
+{
+ use utf8;
+ $_ = ">\x{263A}<";
+ s/([\x{80}-\x{10ffff}])/"&#".ord($1).";"/eg;
+ ok $_, '>☺<';
+ $test++;
+
+ $_ = ">\x{263A}<";
+ my $rx = "\x{80}-\x{10ffff}";
+ s/([$rx])/"&#".ord($1).";"/eg;
+ ok $_, '>☺<';
+ $test++;
+
+ $_ = ">\x{263A}<";
+ my $rx = "\\x{80}-\\x{10ffff}";
+ s/([$rx])/"&#".ord($1).";"/eg;
+ ok $_, '>☺<';
+ $test++;
+}