Skip to content

[Bug]: truncate splits emoji into broken surrogate pairs #27842

Open

Description

@samkelly880

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

packages/shared

Steps to reproduce

Call truncate("👍👍👍👍", 3) (or any odd maxLength on emoji-heavy text used for titles / work-log labels).

Expected behavior

Whole emoji only, e.g. "👍👍👍...".

Actual behavior

slice cuts mid-surrogate, producing a lone high surrogate before "...".

Impact

Minor bug or occasional failure

Fix

#27841

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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