diff --git a/src/suggest.cpp b/src/suggest.cpp index 70f688a..deed674 100644 --- a/src/suggest.cpp +++ b/src/suggest.cpp @@ -891,6 +891,13 @@ void run_cg(std::istream& is, std::ostream& os, const hfst::HfstTransducer& t, b void Suggest::run(std::istream& is, std::ostream& os, bool json) { + try { + auto _old = std::locale::global(std::locale("")); + } + catch (const std::runtime_error& e) + { + std::cerr << "WARNING: Couldn't set global locale \"\" (locale-specific native environment): " << e.what() << std::endl; + } if(json) { while(run_json(is, os) == flushing); } diff --git a/src/suggest.hpp b/src/suggest.hpp index 6c0ebc8..f9fc1fc 100644 --- a/src/suggest.hpp +++ b/src/suggest.hpp @@ -82,7 +82,7 @@ inline Casing getCasing(string input) { if(input.length() < 1) { return mIxed; } - std::locale loc(""); + std::locale loc; bool seenupper = false; bool seenlower = false; bool fstupper = false;