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

Merged

Conversation

CookiePLMonster
Copy link
Contributor

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
Copy link
Contributor

cremno 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
Copy link
Contributor Author

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.

@JosJuice JosJuice merged commit 9d64890 into dolphin-emu:master Sep 28, 2019
@CookiePLMonster CookiePLMonster deleted the win-utf8-console-output branch September 28, 2019 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants