mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
tools/dhtnode: use utf-8 for console output on Windows
This commit is contained in:
1 parent
44508cd040
commit
80d0648d6d
1 file changed
+8
@@ -27,6 +27,10 @@ extern "C" {
|
||||
#include <gnutls/gnutls.h>
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <ConsoleApi2.h>
|
||||
#endif
|
||||
|
||||
#include <set>
|
||||
#include <thread> // std::this_thread::sleep_for
|
||||
|
||||
@@ -515,6 +519,10 @@ void cmd_loop(std::shared_ptr<DhtRunner>& node, dht_params& params
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
SetConsoleOutputCP(CP_UTF8);
|
||||
SetConsoleCP(CP_UTF8);
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
if (auto err = gnutls_global_init()) {
|
||||
std::cerr << "Failed to initialize GnuTLS: " << gnutls_strerror(err) << std::endl;
|
||||
|
||||
Reference in new issue
Block a user