aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2022-03-15 20:44:03 +0000
committerGitHub <noreply@github.com>2022-03-15 20:44:03 +0000
commit2df9d3537bb4836096e157c81de20d4fa937db9a (patch)
tree4fd53173b9b8a5deb2adc2f9a1e09fe275ecf68d
parente327050bd125316ce36efa607cc50d012d100cc3 (diff)
parent53ddbbaa8584bac463718ba4837d1ee8f79d88c4 (diff)
downloadnextpnr-2df9d3537bb4836096e157c81de20d4fa937db9a.tar.gz
nextpnr-2df9d3537bb4836096e157c81de20d4fa937db9a.tar.bz2
nextpnr-2df9d3537bb4836096e157c81de20d4fa937db9a.zip
Merge pull request #943 from yrabbit/locale
gowin: support for locales other than en_US and C
-rw-r--r--common/command.cc10
-rw-r--r--gowin/main.cc1
2 files changed, 10 insertions, 1 deletions
diff --git a/common/command.cc b/common/command.cc
index 2167deb9..0de9ccc4 100644
--- a/common/command.cc
+++ b/common/command.cc
@@ -45,7 +45,15 @@
NEXTPNR_NAMESPACE_BEGIN
-CommandHandler::CommandHandler(int argc, char **argv) : argc(argc), argv(argv) { log_streams.clear(); }
+CommandHandler::CommandHandler(int argc, char **argv) : argc(argc), argv(argv)
+{
+ try {
+ std::locale::global(std::locale(""));
+ } catch (const std::runtime_error &e) {
+ // the locale is broken in this system, so leave it as it is
+ }
+ log_streams.clear();
+}
bool CommandHandler::parseOptions()
{
diff --git a/gowin/main.cc b/gowin/main.cc
index 1473f3e8..19c1d02c 100644
--- a/gowin/main.cc
+++ b/gowin/main.cc
@@ -21,6 +21,7 @@
#ifdef MAIN_EXECUTABLE
#include <fstream>
+#include <locale>
#include <regex>
#include "command.h"
#include "design_utils.h"