diff options
author | Kalle Wallin <kaw@linux.se> | 2004-06-06 14:11:06 +0000 |
---|---|---|
committer | Kalle Wallin <kaw@linux.se> | 2004-06-06 14:11:06 +0000 |
commit | ab7b4998b156a959c21b8d277f5ae114f48427c9 (patch) | |
tree | 2a335a2d69f87f781a81d76fe84d08fd962e1095 /src/support.c | |
parent | ddd95cfda00af6e9093b8958af5679cf9b9cc54f (diff) | |
download | mpd-ab7b4998b156a959c21b8d277f5ae114f48427c9.tar.gz mpd-ab7b4998b156a959c21b8d277f5ae114f48427c9.tar.xz mpd-ab7b4998b156a959c21b8d277f5ae114f48427c9.zip |
Moved charset initialization code to main.c, added bind_textdomain_codeset()
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1350 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/support.c')
-rw-r--r-- | src/support.c | 41 |
1 files changed, 8 insertions, 33 deletions
diff --git a/src/support.c b/src/support.c index 8cb4ecafd..6ba261213 100644 --- a/src/support.c +++ b/src/support.c @@ -1,4 +1,6 @@ /* + * $Id$ + * * (c) 2004 by Kalle Wallin (kaw@linux.se) * * This program is free software; you can redistribute it and/or modify @@ -26,16 +28,10 @@ #include "ncmpc.h" #include "support.h" -#ifdef HAVE_LOCALE_H -#include <locale.h> -#endif - #define BUFSIZE 1024 extern void screen_status_printf(char *format, ...); -static const char *charset = NULL; -static const char *locale = NULL; static gboolean noconvert = TRUE; char * @@ -120,34 +116,10 @@ strcasestr(const char *haystack, const char *needle) } #endif /* HAVE_STRCASESTR */ - -int -charset_init(void) -{ -#ifdef HAVE_LOCALE_H - /* get current locale */ - if( (locale=setlocale(LC_CTYPE,"")) == NULL ) - { - g_printerr("setlocale() - failed!\n"); - return -1; - } -#endif - - /* get charset */ - noconvert = g_get_charset(&charset); - -#ifdef DEBUG - g_printerr("charset: %s [%d]\n", charset, noconvert); - fflush(stderr); -#endif - - return 0; -} - -int -charset_close(void) +void +charset_init(gboolean disable) { - return 0; + noconvert = disable; } char * @@ -169,6 +141,9 @@ utf8_to_locale(char *utf8str) &error); if( error ) { + const char *charset; + + g_get_charset(&charset); screen_status_printf(_("Error: Unable to convert characters to %s"), charset); D(g_printerr("utf8_to_locale(): %s\n", error->message)); |