PSReadLine icon indicating copy to clipboard operation
PSReadLine copied to clipboard

Fix handling of surrogate pairs in length calculation

Open totkeks opened this issue 10 months ago • 1 comments

PR Summary

Adds new conditions to handle surrogate pairs when calculating the buffer length of a string.

Fixes https://github.com/PowerShell/PSReadLine/issues/3857.

PR Checklist

  • [X] PR has a meaningful title
    • Use the present tense and imperative mood when describing your changes
  • [X] Summarized changes
  • [ ] Make sure you've added one or more new tests
  • [X] Make sure you've tested these changes in terminals that PowerShell is commonly used in (i.e. conhost.exe, Windows Terminal, Visual Studio Code Integrated Terminal, etc.)
  • User-facing changes
    • [X] Not Applicable
Microsoft Reviewers: Open in CodeFlow

totkeks avatar Feb 07 '25 22:02 totkeks

@microsoft-github-policy-service agree

totkeks avatar Feb 08 '25 15:02 totkeks

I think this pull request needs a unit-test to demonstrate the requirements.

springcomp avatar Apr 02 '25 09:04 springcomp