dolphinsmalltalk / Dolphin

Dolphin Smalltalk Core Image
MIT License
301 stars 58 forks source link

String>>endsWith: may not work correctly for UTF-encoded strings #1258

Closed blairmcg closed 9 months ago

blairmcg commented 9 months ago

SequenceableCollection>>endsWith: is inherited by UtfEncodedString and subclasses, but does not work correctly for extended characters requiring multiple code units.

Repro Steps

Evaluate, for example: 'ab🐬c' endsWith: 'b🐬c'

Expected behavior Result should be true

Actual behaviour Result is false

Additional context The complimentary beginsWith: operation had a similar fault but that was fixed as part of the changes for #1019