mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-10 07:20:23 -04:00
CLI: Add Unicode support on Windows (#8618)
This commit is contained in:
parent
37baa6fd25
commit
ab95690043
7 changed files with 47 additions and 0 deletions
|
@ -65,6 +65,9 @@ install(TARGETS keepassxc-cli
|
|||
RUNTIME DESTINATION ${CLI_INSTALL_DIR} COMPONENT Runtime)
|
||||
|
||||
if(WIN32)
|
||||
target_sources(keepassxc-cli
|
||||
PRIVATE keepassxc-cli.exe.manifest)
|
||||
|
||||
# install(CODE "include(BundleUtilities)
|
||||
# fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/keepassxc-cli.exe\" \"\" \"\")"
|
||||
# COMPONENT Runtime)
|
||||
|
|
|
@ -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)
|
||||
|
|
8
src/cli/keepassxc-cli.exe.manifest
Normal file
8
src/cli/keepassxc-cli.exe.manifest
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<application>
|
||||
<windowsSettings>
|
||||
<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
</assembly>
|
Loading…
Add table
Add a link
Reference in a new issue