Skip to content

Emoji characters are split at surrogates #1573

@jasonsemkohoag

Description

@jasonsemkohoag
"Hello 😄".Truncate(MaxMessagePreviewLength, Truncator.FixedLength)

The 😄 takes up 2 spots and if I happen to split right on it I'll get a split emoji (\ud83d instead of \ud83d\ude04) which results in a question mark

Is there a way to Truncate at a fixed length and if the length is right at a split for something like an emoji, it includes it or excludes it?

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