p4raw-id: //depot/perl@22976
#!./perl
-print "1..189\n";
+print "1..190\n";
#P = start of string Q = start of substr R = end of substr S = end of string
ok 189, substr($text,$pos,1) eq $pos;
}
+
+# [perl #23765]
+{
+ my $a = pack("C", 0xbf);
+ substr($a, -1) &= chr(0xfeff);
+ ok 190, $a eq "\xbf";
+}