Actions
Bug #6167
closedString#count: wrong result for multiple complements of multi-byte characters
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.3.0]
Backport:
Description
"\u0100\u0101".count("^\u0100", "^\u0101")
=> 2
Since multiple arguments are intersected, the expected result is 0. Compare:
"\u0080\u0081".count("^\u0080", "^\u0081")
=> 0
This takes a different path through tr_setup_table and returns the correct result.
Analogous bugs exists in String#squeeze and String#delete, which also use tr_setup_table.
Actions
Like0
Like0Like0