diff --git a/src/utils/filenamehandler.cpp b/src/utils/filenamehandler.cpp index 22119bac..928a7849 100644 --- a/src/utils/filenamehandler.cpp +++ b/src/utils/filenamehandler.cpp @@ -20,12 +20,23 @@ #include #include #include +#include #include +#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_DEBUG +#include "spdlog/cfg/env.h" +#include "spdlog/spdlog.h" + FileNameHandler::FileNameHandler(QObject* parent) : QObject(parent) { - std::locale::global(std::locale("")); + try { + std::locale::global(std::locale("")); + } catch (std::exception& e) { + spdlog::error("Locales on your system are not properly configured. " + "Falling back to defaults"); + std::locale::global(std::locale("en_US.UTF-8")); + } } QString FileNameHandler::parsedPattern()