summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6c7f5d1)
raw | patch | inline | side by side (parent: 6c7f5d1)
author | gustav_b <gustav_b@users.sourceforge.net> | |
Wed, 1 Nov 2006 01:37:29 +0000 (01:37 +0000) | ||
committer | gustav_b <gustav_b@users.sourceforge.net> | |
Wed, 1 Nov 2006 01:37:29 +0000 (01:37 +0000) |
locale setting -- fallback to classic.
src/util/ucompose.hpp | patch | blob | history |
diff --git a/src/util/ucompose.hpp b/src/util/ucompose.hpp
index d29cf5424f5d5ff69df1b91539060c5cd651463b..af5edbc859451f22fa267a34208d464a12b1d711 100644 (file)
--- a/src/util/ucompose.hpp
+++ b/src/util/ucompose.hpp
: 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;