Set the locale as early as possible
Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
This commit is contained in:
parent
ad00f3fdeb
commit
53ddbbaa85
@ -45,7 +45,15 @@
|
|||||||
|
|
||||||
NEXTPNR_NAMESPACE_BEGIN
|
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()
|
bool CommandHandler::parseOptions()
|
||||||
{
|
{
|
||||||
|
@ -91,15 +91,6 @@ void GowinCommandHandler::customAfterLoad(Context *ctx)
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
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.
|
|
||||||
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);
|
GowinCommandHandler handler(argc, argv);
|
||||||
return handler.exec();
|
return handler.exec();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user