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

ConsoleListenerWin: Properly output console logging in UTF-16 #8341

Open
wants to merge 1 commit into
base: master
from

Conversation

@CookiePLMonster
Copy link
Contributor

commented Aug 30, 2019

Minor fix, Windows builds used OutputDebugStringA for Console Logger which doesn't handle UTF-8 correctly (A functions assume a local (ACP) codepage). This change explicitly converts an input UTF-8 string to UTF-16 beforehand and passes it to `OutputDebugStringW' instead.

This will impact any logging with UTF-8 in it - the most possible scenario is user paths.

Before:
image

After:
image

@cremno

This comment has been minimized.

Copy link
Contributor

commented Aug 31, 2019

On the other hand Win10 and debugger support are required to support Unicode OutputDebugStringW. While the name suggests otherwise the function was essentially a non-Unicode OutputDebugStringA call before.

I guess broken output on older Windows versions might be preferable than broken output on all Windows versions.

@CookiePLMonster

This comment has been minimized.

Copy link
Contributor Author

commented Aug 31, 2019

On the other hand Win10 and debugger support are required to support Unicode OutputDebugStringW. While the name suggests otherwise the function was essentially a non-Unicode OutputDebugStringA call before.

I see this now, yeah. However, since the function itself exists since Windows XP it's essentially a non-issue IMO. If output is going to be broken - tough luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.