diff mcabber/src/utils.h @ 592:67a332121aea

Try UTF8 -> locale conversion with fallback
author Mikael Berthe <mikael@lilotux.net>
date Sun, 11 Dec 2005 11:11:34 +0100
parents fed6d1e4d7a9
children de6837908702
line wrap: on
line diff
--- a/mcabber/src/utils.h	Sat Dec 10 23:52:04 2005 +0100
+++ b/mcabber/src/utils.h	Sun Dec 11 11:11:34 2005 +0100
@@ -1,8 +1,11 @@
 #ifndef __UTILS_H__
 #define __UTILS_H__ 1
 
+extern char *LocaleCharSet;
+
 #define to_utf8(s)   ((s) ? g_locale_to_utf8((s),   -1, NULL,NULL,NULL) : NULL)
-#define from_utf8(s) ((s) ? g_locale_from_utf8((s), -1, NULL,NULL,NULL) : NULL)
+#define from_utf8(s) ((s) ? g_convert_with_fallback((s), -1, LocaleCharSet, \
+                                        "UTF-8", NULL,NULL,NULL,NULL) : NULL)
 
 void ut_InitDebug(unsigned int level, const char *file);
 void ut_WriteLog(unsigned int flag, const char *data);