diff options
Diffstat (limited to 'src/FbTk/FbString.cc')
-rw-r--r-- | src/FbTk/FbString.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/FbTk/FbString.cc b/src/FbTk/FbString.cc index 26eb058..7a0ef1b 100644 --- a/src/FbTk/FbString.cc +++ b/src/FbTk/FbString.cc | |||
@@ -56,14 +56,14 @@ static int iconv_convs[CONVSIZE]; | |||
56 | 56 | ||
57 | /// Initialise all of the iconv conversion descriptors | 57 | /// Initialise all of the iconv conversion descriptors |
58 | void init() { | 58 | void init() { |
59 | setlocale(LC_CTYPE, ""); | ||
60 | |||
61 | #ifdef HAVE_ICONV | ||
59 | if (iconv_convs != 0) | 62 | if (iconv_convs != 0) |
60 | return; | 63 | return; |
61 | 64 | ||
62 | iconv_convs = new iconv_t[CONVSIZE]; | 65 | iconv_convs = new iconv_t[CONVSIZE]; |
63 | 66 | ||
64 | setlocale(LC_CTYPE, ""); | ||
65 | |||
66 | #ifdef HAVE_ICONV | ||
67 | #ifdef CODESET | 67 | #ifdef CODESET |
68 | std::string locale_codeset = nl_langinfo(CODESET); | 68 | std::string locale_codeset = nl_langinfo(CODESET); |
69 | #else // openbsd doesnt have this (yet?) | 69 | #else // openbsd doesnt have this (yet?) |
@@ -90,16 +90,17 @@ void init() { | |||
90 | } | 90 | } |
91 | 91 | ||
92 | void shutdown() { | 92 | void shutdown() { |
93 | #ifdef HAVE_ICONV | ||
93 | if (iconv_convs == 0) | 94 | if (iconv_convs == 0) |
94 | return; | 95 | return; |
95 | #ifdef HAVE_ICONV | 96 | |
96 | for (int i=0; i < CONVSIZE; ++i) | 97 | for (int i=0; i < CONVSIZE; ++i) |
97 | if (iconv_convs[i] != (iconv_t)(-1)) | 98 | if (iconv_convs[i] != (iconv_t)(-1)) |
98 | iconv_close(iconv_convs[i]); | 99 | iconv_close(iconv_convs[i]); |
99 | #endif // HAVE_ICONV | ||
100 | 100 | ||
101 | delete[] iconv_convs; | 101 | delete[] iconv_convs; |
102 | iconv_convs = 0; | 102 | iconv_convs = 0; |
103 | #endif // HAVE_ICONV | ||
103 | } | 104 | } |
104 | 105 | ||
105 | 106 | ||