mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
Merge 78a0c238ec
into 51d76634fb
This commit is contained in:
commit
72d9de11a9
14 changed files with 60 additions and 32 deletions
|
@ -31,3 +31,5 @@ BEGIN
|
|||
VALUE "Translation", 0x0, 1252 // language neutral - multilingual (decimal)
|
||||
END
|
||||
END
|
||||
|
||||
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST bitcoin-cli.manifest
|
||||
|
|
|
@ -1313,8 +1313,7 @@ static int CommandLineRPC(int argc, char *argv[])
|
|||
MAIN_FUNCTION
|
||||
{
|
||||
#ifdef WIN32
|
||||
common::WinCmdLineArgs winArgs;
|
||||
std::tie(argc, argv) = winArgs.get();
|
||||
common::WindowsScopedCodePage windows_terminal_output_code_page{CP_UTF8};
|
||||
#endif
|
||||
SetupEnvironment();
|
||||
if (!SetupNetworking()) {
|
||||
|
|
9
src/bitcoin-cli.manifest
Normal file
9
src/bitcoin-cli.manifest
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<assemblyIdentity type="win32" name="org.bitcoincore.bitcoin-cli" version="29.99.0.0"/>
|
||||
<application>
|
||||
<windowsSettings>
|
||||
<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
</assembly>
|
|
@ -31,3 +31,5 @@ BEGIN
|
|||
VALUE "Translation", 0x0, 1252 // language neutral - multilingual (decimal)
|
||||
END
|
||||
END
|
||||
|
||||
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST bitcoin-wallet.manifest
|
||||
|
|
|
@ -98,8 +98,7 @@ MAIN_FUNCTION
|
|||
{
|
||||
ArgsManager& args = gArgs;
|
||||
#ifdef WIN32
|
||||
common::WinCmdLineArgs winArgs;
|
||||
std::tie(argc, argv) = winArgs.get();
|
||||
common::WindowsScopedCodePage windows_terminal_output_code_page{CP_UTF8};
|
||||
#endif
|
||||
|
||||
int exit_status;
|
||||
|
|
9
src/bitcoin-wallet.manifest
Normal file
9
src/bitcoin-wallet.manifest
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<assemblyIdentity type="win32" name="org.bitcoincore.bitcoin-wallet" version="29.99.0.0"/>
|
||||
<application>
|
||||
<windowsSettings>
|
||||
<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
</assembly>
|
|
@ -31,3 +31,5 @@ BEGIN
|
|||
VALUE "Translation", 0x0, 1252 // language neutral - multilingual (decimal)
|
||||
END
|
||||
END
|
||||
|
||||
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST bitcoind.manifest
|
||||
|
|
|
@ -255,8 +255,7 @@ static bool AppInit(NodeContext& node)
|
|||
MAIN_FUNCTION
|
||||
{
|
||||
#ifdef WIN32
|
||||
common::WinCmdLineArgs winArgs;
|
||||
std::tie(argc, argv) = winArgs.get();
|
||||
common::WindowsScopedCodePage windows_terminal_output_code_page{CP_UTF8};
|
||||
#endif
|
||||
|
||||
NodeContext node;
|
||||
|
|
9
src/bitcoind.manifest
Normal file
9
src/bitcoind.manifest
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<assemblyIdentity type="win32" name="org.bitcoincore.bitcoind" version="29.99.0.0"/>
|
||||
<application>
|
||||
<windowsSettings>
|
||||
<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
</assembly>
|
|
@ -867,27 +867,15 @@ void ArgsManager::LogArgs() const
|
|||
|
||||
namespace common {
|
||||
#ifdef WIN32
|
||||
WinCmdLineArgs::WinCmdLineArgs()
|
||||
WindowsScopedCodePage::WindowsScopedCodePage(UINT new_console_outp_code_page)
|
||||
: m_original_code_page{GetConsoleOutputCP()}
|
||||
{
|
||||
wchar_t** wargv = CommandLineToArgvW(GetCommandLineW(), &argc);
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t> utf8_cvt;
|
||||
argv = new char*[argc];
|
||||
args.resize(argc);
|
||||
for (int i = 0; i < argc; i++) {
|
||||
args[i] = utf8_cvt.to_bytes(wargv[i]);
|
||||
argv[i] = &*args[i].begin();
|
||||
}
|
||||
LocalFree(wargv);
|
||||
SetConsoleOutputCP(new_console_outp_code_page);
|
||||
}
|
||||
|
||||
WinCmdLineArgs::~WinCmdLineArgs()
|
||||
WindowsScopedCodePage::~WindowsScopedCodePage()
|
||||
{
|
||||
delete[] argv;
|
||||
}
|
||||
|
||||
std::pair<int, char**> WinCmdLineArgs::get()
|
||||
{
|
||||
return std::make_pair(argc, argv);
|
||||
SetConsoleOutputCP(m_original_code_page);
|
||||
}
|
||||
#endif
|
||||
} // namespace common
|
||||
|
|
|
@ -480,17 +480,17 @@ std::string HelpMessageOpt(const std::string& option, const std::string& message
|
|||
|
||||
namespace common {
|
||||
#ifdef WIN32
|
||||
class WinCmdLineArgs
|
||||
/**
|
||||
* A RAII-style class for temporarily changing the terminal output code page during runtime.
|
||||
*/
|
||||
class WindowsScopedCodePage
|
||||
{
|
||||
public:
|
||||
WinCmdLineArgs();
|
||||
~WinCmdLineArgs();
|
||||
std::pair<int, char**> get();
|
||||
WindowsScopedCodePage(UINT new_console_outp_code_page);
|
||||
~WindowsScopedCodePage();
|
||||
|
||||
private:
|
||||
int argc;
|
||||
char** argv;
|
||||
std::vector<std::string> args;
|
||||
UINT m_original_code_page;
|
||||
};
|
||||
#endif
|
||||
} // namespace common
|
||||
|
|
|
@ -479,8 +479,7 @@ static void SetupUIArgs(ArgsManager& argsman)
|
|||
int GuiMain(int argc, char* argv[])
|
||||
{
|
||||
#ifdef WIN32
|
||||
common::WinCmdLineArgs winArgs;
|
||||
std::tie(argc, argv) = winArgs.get();
|
||||
common::WindowsScopedCodePage windows_terminal_output_code_page{CP_UTF8};
|
||||
#endif
|
||||
|
||||
std::unique_ptr<interfaces::Init> init = interfaces::MakeGuiInit(argc, argv);
|
||||
|
|
|
@ -38,3 +38,5 @@ BEGIN
|
|||
VALUE "Translation", 0x0, 1252 // language neutral - multilingual (decimal)
|
||||
END
|
||||
END
|
||||
|
||||
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST bitcoin-qt.manifest
|
||||
|
|
9
src/qt/res/bitcoin-qt.manifest
Normal file
9
src/qt/res/bitcoin-qt.manifest
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<assemblyIdentity type="win32" name="org.bitcoincore.bitcoin-qt" version="29.99.0.0"/>
|
||||
<application>
|
||||
<windowsSettings>
|
||||
<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
</assembly>
|
Loading…
Add table
Reference in a new issue