diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2005-04-21 15:36:14 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2005-04-21 15:36:14 +0000 |
commit | ec0624293b57ae07d6b2c32bae099d4f163e7e07 (patch) | |
tree | 01d6b0ff58f43fa9a8d6808c0773376527f812a6 /t/op/substr.t | |
parent | a9c4fd4eb137d3951b59e73b4474669240f974c1 (diff) | |
download | perl-ec0624293b57ae07d6b2c32bae099d4f163e7e07.tar.gz |
[perl #34976] substr uses utf8 length cache incorrectly
p4raw-id: //depot/perl@24270
Diffstat (limited to 't/op/substr.t')
-rwxr-xr-x | t/op/substr.t | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/t/op/substr.t b/t/op/substr.t index 9549d29028..2c6a0ed32e 100755 --- a/t/op/substr.t +++ b/t/op/substr.t @@ -1,6 +1,6 @@ #!./perl -print "1..190\n"; +print "1..192\n"; #P = start of string Q = start of substr R = end of substr S = end of string @@ -658,3 +658,10 @@ ok 174, $x eq "\x{100}\x{200}\xFFb"; substr($a, -1) &= chr(0xfeff); ok 190, $a eq "\xbf"; } + +# [perl #34976] incorrect caching of utf8 substr length +{ + my $a = "abcd\x{100}"; + ok 191, substr($a,1,2) eq 'bc'; + ok 192, substr($a,1,1) eq 'b'; +} |