这是indexloc提供的服务,不要输入任何密码
Skip to content

core:unicode/utf8 grapheme_count reported width seems to be wrong for complex emojis #5939

@RichardFevrier

Description

@RichardFevrier

Context

I was trying to add emojis support on my terminal editor when I faced something that I think might be an issue for the grapheme_count reported width for complex emojis like "🏳️‍🌈".

Odin: dev-2025-11:e5153a937
OS: NixOS 25.11 (Xantusia), Linux 6.17.7
CPU: AMD Ryzen 9 5950X 16-Core Processor
RAM: 32008 MiB
Backend: LLVM 20.1.8

Expected Behavior

I was expecting the result 1, 4, 2 for respectively graphemes, runes, width.

Current Behavior

I got 1, 4, 1.

It seems for be the same for decode_grapheme_clusters.
For the decode_grapheme_iterate it seems to be a bit different, the reported grapheme seems wrong, but if you check the last_... in the iterator struct you get (I think) the right values.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions