Skip to content

The string form of displayWidth() is ignorant about graphemes #1

@gdamore

Description

@gdamore

displayWidth() does not understand e.g. combining characters and the use of ZWJ to accurately provide display width -- it assumes that each dchar can be taken as is.

The technically "correct" would be to to use std.uni to break down the string into graphemes.

Unfortunately, std.uni is also broken for relatively modern graphemes. Still, if this package were to use the grapheme support in std.uni, then when that package got fixed, it would likely do better here. Additionally there are numerous sequences for which std.uni is not broken.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions