summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorgustav_b <gustav_b@users.sourceforge.net>2006-11-01 01:37:29 +0000
committergustav_b <gustav_b@users.sourceforge.net>2006-11-01 01:37:29 +0000
commit670dcfb9eebda3f705634ef51c05e841539675be (patch)
treeebd8e07e247cf726c0eb3cad1084f2e86c0e5e69 /src
parentmake svg numeric precision, minimum exponent, and the use of named colors (as... (diff)
downloadinkscape-670dcfb9eebda3f705634ef51c05e841539675be.tar.gz
inkscape-670dcfb9eebda3f705634ef51c05e841539675be.zip
util/ucompose.hpp: catch exception thrown when user has an unsupported
locale setting -- fallback to classic. (bzr r1878)
Diffstat (limited to 'src')
-rw-r--r--src/util/ucompose.hpp7
1 files changed, 6 insertions, 1 deletions
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;