From ad00f3fdeb9e48a63c2781815d265266123f2621 Mon Sep 17 00:00:00 2001 From: YRabbit Date: Tue, 15 Mar 2022 21:52:32 +1000 Subject: gowin: test locale workaround Signed-off-by: YRabbit --- gowin/main.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gowin/main.cc b/gowin/main.cc index db74545e..e3c6762b 100644 --- a/gowin/main.cc +++ b/gowin/main.cc @@ -95,7 +95,11 @@ int main(int argc, char *argv[]) // 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("")); + 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 + } GowinCommandHandler handler(argc, argv); return handler.exec(); } -- cgit v1.2.3