Project

General

Profile

Actions

Bug #20305

closed

commit 1d2d25dcadda0764f303183ac091d0c87b432566 breaks grapheme_clusters

Added by fablestales (Fable Tales) 5 months ago. Updated 21 days ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:116960]

Description

given a script:

#script.rb
p "안녕".byteslice(0, 4).grapheme_clusters

The commit 1d2d25dcadda0764f303183ac091d0c87b432566 (https://github.com/ruby/ruby/commit/1d2d25dcadda0764f303183ac091d0c87b432566) breaks the grapheme_clusters method on a byte slice

(commit 1d2d25dcadda0764f303183ac091d0c87b432566)
 ((HEAD detached at 1d2d25dcad)) $ ./ruby --disable=gems script.rb
["안", "\xEB"]
 ((HEAD detached at 1d2d25dcad)) $ git checkout HEAD^
(114e71d06280f9c57b9859ee4405ae89a989ddb6)
 ((HEAD detached at 114e71d062)) $ make -j
...
 ((HEAD detached at 114e71d062)) $ ./ruby --disable=gems script.rb
["안"]
 ((HEAD detached at 114e71d062)) $ cat script.rb
p "안녕".byteslice(0, 4).grapheme_clusters

the expected result here is almost certainly the latter output, and not the former.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0