From: gustav_b Date: Wed, 1 Nov 2006 01:37:29 +0000 (+0000) Subject: util/ucompose.hpp: catch exception thrown when user has an unsupported X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f85ce7f3872bd45fbe54a1de38f2e0b921b62f56;p=inkscape.git util/ucompose.hpp: catch exception thrown when user has an unsupported locale setting -- fallback to classic. --- diff --git a/src/util/ucompose.hpp b/src/util/ucompose.hpp index d29cf5424..af5edbc85 100644 --- a/src/util/ucompose.hpp +++ b/src/util/ucompose.hpp @@ -182,7 +182,12 @@ namespace UStringPrivate : arg_no(1) { #if __GNUC__ >= 3 - os.imbue(std::locale("")); // use the user's locale for the stream + try { + os.imbue(std::locale("")); // use the user's locale for the stream + } + catch (std::runtime_error& e) { // fallback to classic if it failed + os.imbue(std::locale::classic()); + } #endif std::string::size_type b = 0, i = 0;