-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix stdin/stdout encoding on Windows.
QTextStream uses the system default locale, but this breaks in various situations: (1) It does not work on the native Windows shell (cmd.exe, Powershell), since the default Windows locale is Windows-1252, but the shell uses Windows-850. (2) It also breaks on *nix systems where the locale is Latin1 or C, which is the case for most CI systems or build servers. We allow overriding the detected codec by setting the ENCODING_OVERRIDE environment variable, but otherwise prefer Windows-850 on Windows and UTF-8 on any other system, even if LANG is set to something else. This resolves #2413
- Loading branch information
Showing
19 changed files
with
180 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
#include <utility> | ||
|
||
/* | ||
* Copyright (C) 2017 KeePassXC Team <[email protected]> | ||
* | ||
|
@@ -24,8 +22,8 @@ | |
|
||
#include <QCommandLineParser> | ||
#include <QStringList> | ||
#include <QTextStream> | ||
|
||
#include "cli/TextStream.h" | ||
#include "cli/Utils.h" | ||
#include "core/Global.h" | ||
#include "core/Database.h" | ||
|
@@ -44,7 +42,7 @@ Locate::~Locate() | |
|
||
int Locate::execute(const QStringList& arguments) | ||
{ | ||
QTextStream out(Utils::STDOUT, QIODevice::WriteOnly); | ||
TextStream out(Utils::STDOUT, QIODevice::WriteOnly); | ||
|
||
QCommandLineParser parser; | ||
parser.setApplicationDescription(description); | ||
|
@@ -73,8 +71,8 @@ int Locate::execute(const QStringList& arguments) | |
|
||
int Locate::locateEntry(Database* database, const QString& searchTerm) | ||
{ | ||
QTextStream out(Utils::STDOUT, QIODevice::WriteOnly); | ||
QTextStream err(Utils::STDERR, QIODevice::WriteOnly); | ||
TextStream out(Utils::STDOUT, QIODevice::WriteOnly); | ||
TextStream err(Utils::STDERR, QIODevice::WriteOnly); | ||
|
||
QStringList results = database->rootGroup()->locate(searchTerm); | ||
if (results.isEmpty()) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.