Skip to content

Support grapheme detection via \X #4568

@janlelis

Description

@janlelis

JRuby should support matching "grapheme clusters" (glyphs), which are constructed using mutliple Unicode codepoints.

Expected Behavior (MRI)

glyphs = "\u{61 308 62}".scan(/\X/) # => ["ä", "b"]`
glyphs.map{ |e| e.codepoints.map{ |f| f.to_s(16) } } #=> [["61", "308"], ["62"]]

Actual Behavior (JRuby)

glyphs = "\u{61 308 62}".scan(/\X/) # =>  ["a", "b"]`
glyphs.map{ |e| e.codepoints.map{ |f| f.to_s(16) } } #=> [["61"], ["62"]]

Related Links

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions