Skip to content

Fix Windows UTF-16 translation buffer size - #1103

Open
subotac wants to merge 1 commit into
crossterm-rs:masterfrom
subotac:fix/windows-utf16-buffer
Open

Fix Windows UTF-16 translation buffer size#1103
subotac wants to merge 1 commit into
crossterm-rs:masterfrom
subotac:fix/windows-utf16-buffer

Conversation

@subotac

@subotac subotac commented Aug 4, 2026

Copy link
Copy Markdown

Fixes #1092.

utf16_buf was initialized as a two-element array ([0u16, 16]) while its length is passed to ToUnicodeEx. Initialize the intended 16-element zeroed buffer so translations requiring more than two UTF-16 code units
have sufficient capacity.

Tests:

  • cargo fmt --all -- --check
  • cargo check --locked --lib --no-default-features --features windows,events
  • cargo clippy --locked --lib --no-default-features --features windows,events -- -D warnings

@subotac
subotac requested a review from TimonPost as a code owner August 4, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

utf16_buf is a two-element array, not sixteen (comma for semicolon in get_char_for_key)

1 participant