diff options
-rw-r--r-- | gowin/main.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gowin/main.cc b/gowin/main.cc index 1473f3e8..db74545e 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" @@ -90,6 +91,11 @@ void GowinCommandHandler::customAfterLoad(Context *ctx) int main(int argc, char *argv[]) { + // set the locale here because when you create a context you create several + // floating point strings whose representation depends on the locale. If + // you don't do this, the strings will be in the C locale and later when Qt + // starts it won't be able to read them back as numbers. + std::locale::global(std::locale("")); GowinCommandHandler handler(argc, argv); return handler.exec(); } |