Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WM_CHAR does not function properly when _UNICODE is defined #283

Open
GitMensch opened this issue Mar 4, 2023 · 0 comments
Open

WM_CHAR does not function properly when _UNICODE is defined #283

GitMensch opened this issue Mar 4, 2023 · 0 comments

Comments

@GitMensch
Copy link
Collaborator

My app that uses PDCursesMod is compiled with the Use Unicode Character Set option with MSVC++, which will ensure all Win32 API calls use the wide-character variants, all of which use UTF16 encoded characters and strings regardless of the user's selected locale.

That means that when _UNICODE is defined the character sent to the WM_CHAR message is UTF16 encoded -- and PDCursesMod adds it to key queue directly via add_key_to_queue((int) wParam); My app defines PDC_FORCE_UTF8, so I was assuming that internally this character would be converted to a sequence of UTF8 bytes to be received by getch() calls.

However, this was not the case, and parsing some non-ascii characters was problematic.

Originally posted by @clangen in #260 where @Bill-Gray presented a different (still unfinished) approach.

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

No branches or pull requests

1 participant