CLI: Add Unicode support on Windows (#8618)

This commit is contained in:
Matthew Donoughe authored and GitHub committed 2022-10-29 08:07:31 -04:00
1 parent 37baa6fd25
commit ab95690043
7 files changed
+47

No files matched your search

+7
View File
@@ -63,6 +63,13 @@ namespace Utils
fd->open(fopen("/dev/null", "w"), QIODevice::WriteOnly);
#endif
DEVNULL.setDevice(fd);
#ifdef Q_OS_WIN
// On Windows, we ask via keepassxc-cli.exe.manifest to use UTF-8,
// but the console code-page isn't automatically changed to match.
SetConsoleCP(GetACP());
SetConsoleOutputCP(GetACP());
#endif
}
void setStdinEcho(bool enable = true)