Update of /cvsroot/gaim/gaim/src
In directory usw-pr-cvs1:/tmp/cvs-serv20353/src
Modified Files:
core.h gaim.h util.c
Log Message:
Is ISO-8859 a good default charset to use if one doesn't have nl_langinfo?
Index: core.h
===================================================================
RCS file: /cvsroot/gaim/gaim/src/core.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- core.h 2 Aug 2002 04:52:48 -0000 1.19
+++ core.h 2 Aug 2002 05:19:52 -0000 1.20
@@ -26,8 +26,14 @@
#include <config.h>
#endif
+#ifdef HAVE_ICONV
#include <iconv.h>
+#endif
+
+#ifdef HAVE_LANGINFO_CODESET
#include <langinfo.h>
+#endif
+
#include <stdio.h>
#include <time.h>
#include <glib.h>
Index: gaim.h
===================================================================
RCS file: /cvsroot/gaim/gaim/src/gaim.h,v
retrieving revision 1.328
retrieving revision 1.329
diff -u -d -r1.328 -r1.329
--- gaim.h 2 Aug 2002 04:52:48 -0000 1.328
+++ gaim.h 2 Aug 2002 05:19:52 -0000 1.329
@@ -433,8 +433,14 @@
extern time_t get_time(int, int, int, int, int, int);
extern FILE *gaim_mkstemp(gchar **);
extern char *convert_string(char *, const char *, const char *);
+
+#ifdef HAVE_LANGINFO_CODESET
#define utf8_to_str(in) convert_string(in, nl_langinfo(CODESET), "UTF-8");
#define str_to_utf8(in) convert_string(in, "UTF-8", nl_langinfo(CODESET));
+#else
+#define utf8_to_str(in) convert_string(in, "ISO-8859-1", "UTF-8");
+#define str_to_utf8(in) convert_string(in, "UTF-8", "ISO-8859-1");
+#endif
/*------------------------------------------------------------------------*/
/* Multi-Entry dialog and vCard dialog support */
Index: util.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/util.c,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -d -r1.124 -r1.125
--- util.c 2 Aug 2002 04:33:50 -0000 1.124
+++ util.c 2 Aug 2002 05:19:52 -0000 1.125
@@ -1121,6 +1121,7 @@
char *convert_string(char *str, const char *destset, const char *srcset)
{
+#ifdef HAVE_ICONV
char *buf;
iconv_t cd;
size_t insize = 0;
@@ -1158,6 +1159,8 @@
g_free(buf);
return ret;
+#else
+ return g_strdup(str);
}
void strip_linefeed(gchar *text)
|