[PR #14746] Minor improvements for SplitToOem #30241

Closed
opened 2026-01-31 09:39:31 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/14746

State: closed
Merged: Yes


When working on #14745 I noticed that SplitToOem was in a bit of a poor state
as well. Instead of simply iterating over its deque argument and writing the
results into a new deque it used pop to advance the head of both queues.
This isn't quite exception safe and rather bloaty. Additionally there's no need
to call WideCharToMultiByte twice on each character if we know that the most
verbose encoding is UTF-8 which can't be any more than 4 chars anyways.

Related to #8000.

PR Checklist

  • 2 unit tests cover this
**Original Pull Request:** https://github.com/microsoft/terminal/pull/14746 **State:** closed **Merged:** Yes --- When working on #14745 I noticed that `SplitToOem` was in a bit of a poor state as well. Instead of simply iterating over its `deque` argument and writing the results into a new `deque` it used `pop` to advance the head of both queues. This isn't quite exception safe and rather bloaty. Additionally there's no need to call `WideCharToMultiByte` twice on each character if we know that the most verbose encoding is UTF-8 which can't be any more than 4 chars anyways. Related to #8000. ## PR Checklist * 2 unit tests cover this ✅
claunia added the pull-request label 2026-01-31 09:39:31 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#30241