Skip to content

Commit

Permalink
core: force to use C.UTF-8 for numeric conversions (to_string).
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-0x7C6 committed Jul 28, 2020
1 parent 304166d commit 03ed0a2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
#include <QApplication>

#include <clocale>
#include <iostream>

#include "mainwindow.h"

int main(int argc, char *argv[]) {
// use dot separator for gcode generation
std::setlocale(LC_NUMERIC, "C.UTF-8");

if (auto sample = std::to_string(1.2); sample.find('.') == std::string::npos) {
std::cerr << "C library implementation not supporting C.UTF-8" << std::endl;
return 1;
}

QApplication application(argc, argv);
MainWindow window;
window.showMaximized();
Expand Down

0 comments on commit 03ed0a2

Please sign in to comment.