Sending unicode character via KEYEVENTF_UNICODE/VK_PACKET in SendInput outputs the wrong characters #17334

Open
opened 2026-01-31 05:39:29 +00:00 by claunia · 0 comments
Owner

Originally created by @jtroo on GitHub (Apr 25, 2022).

Windows Terminal version

1.12.10982.0

Windows build number

10.0.19043

Other Software

Reproducible in:

  • cmd.exe
  • wsl ubuntu 20.04

powershell just displays ?? , not sure which behaviour is more incorrect

Uses SendInput:
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendinput

Steps to reproduce

Via SendInput, send the unicode character 🙁

E.g. in
https://github.com/jtroo/kanata/blob/master/src/oskbd/windows.rs#L168

Expected Behavior

The correct unicode value gets typed in: 🙁

Actual Behavior

The characters 翿翿 are typed in instead

Additional info

When copy-pasting the unicode character, it's rendered correctly (in cmd/wsl). It's just not typed correctly via SendInput.

Originally created by @jtroo on GitHub (Apr 25, 2022). ### Windows Terminal version 1.12.10982.0 ### Windows build number 10.0.19043 ### Other Software Reproducible in: - cmd.exe - wsl ubuntu 20.04 powershell just displays `?? `, not sure which behaviour is more incorrect Uses SendInput: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendinput ### Steps to reproduce Via SendInput, send the unicode character 🙁 E.g. in https://github.com/jtroo/kanata/blob/master/src/oskbd/windows.rs#L168 ### Expected Behavior The correct unicode value gets typed in: 🙁 ### Actual Behavior The characters `翿翿` are typed in instead ### Additional info When copy-pasting the unicode character, it's rendered correctly (in cmd/wsl). It's just not typed correctly via SendInput.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17334