Skip to content

Wrong width for ❄️ #22

Closed
Closed
@imsnif

Description

@imsnif

Hey there - we've been using this library extensively for calculating widths and it's frankly been a godsend. Thank you for it.

I recently found an issue which has to do with the character: ❄️
I'm not sure how to better represent it so it won't get lost in formatting, so I'm going to try the output of this snippet:

fn main() {
    let my_chars = "❄️".chars();
    println!("{:?}", my_chars);
}
// prints: Chars(['❄', '\u{fe0f}'])

However, when using unicode-width, it's calculated as 1:

fn main() {
    println!("{:?}", "❄️".width());
}
// prints: 1

I'm far from being an expert here, I just know that this offsets our UI in Zellij in some cases. I hope I'm not barking up the wrong tree?

Thanks!

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