aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-05 18:37:39 +0100
committerMax Kellermann <max@duempel.org>2008-11-05 18:37:39 +0100
commitb35ca9e5c4d45eceba1baf355dea3349cadb73b4 (patch)
tree5e21d802ac268bfb86a73c4caa2ee5c8531aac1c /src
parent2a1a37107f5498b19a1336d73ea724d9d08f0588 (diff)
main: initialize locale (LC_CTYPE)
Initialize libc's locale functions. Currently, we are only interested in LC_CTYPE (character classification), because this is what is used by GLib's g_get_charset().
Diffstat (limited to 'src')
-rw-r--r--src/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 39293bb1..365d1780 100644
--- a/src/main.c
+++ b/src/main.c
@@ -53,6 +53,10 @@
#include <glib.h>
+#ifdef HAVE_LOCALE
+#include <locale.h>
+#endif
+
#define SYSTEM_CONFIG_FILE_LOCATION "/etc/mpd.conf"
#define USER_CONFIG_FILE_LOCATION "/.mpdconf"
@@ -382,6 +386,11 @@ int main(int argc, char *argv[])
Options options;
clock_t start;
+#ifdef HAVE_LOCALE
+ /* initialize locale */
+ setlocale(LC_CTYPE,"");
+#endif
+
/* enable GLib's thread safety code */
g_thread_init(NULL);