diff --git a/src/main.cpp b/src/main.cpp index e8219d4..7aa46fa 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -70,8 +70,15 @@ AsmParserConfiguration getConfigurationFromCommandline(const int argc, const cha int main(int argc, const char **argv) { - std::locale loc("en_US.UTF-8"); - std::locale::global(loc); + try { + std::locale loc("en_US.UTF-8"); + std::locale::global(loc); + } catch (const std::runtime_error& e) { + std::cerr << "Failed to set locale: " << e.what() << std::endl; + std::cerr << "Please make sure that the locale is installed on your system:" << std::endl; + std::cerr << "$ sudo apt-get install locales" << std::endl; + std::cerr << "$ locale-gen en_US.UTF-8" << std::endl; + } AsmParser::global_start_timer();