diff finch/libgnt/gntutils.c @ 18872:85b155a574a3

libgnt.localize Start working towards non-utf8 locale support.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 11 Aug 2007 04:18:14 +0000
parents cf7297803a73
children 7066896f6628
line wrap: on
line diff
--- a/finch/libgnt/gntutils.c	Sat Aug 11 04:17:15 2007 +0000
+++ b/finch/libgnt/gntutils.c	Sat Aug 11 04:18:14 2007 +0000
@@ -409,3 +409,14 @@
 	g_signal_connect_swapped(G_OBJECT(button), "destroy", G_CALLBACK(free_trigger_button), tb);
 }
 
+const char *gnt_util_localize_string(const char *string)
+{
+	static char *loc = NULL;
+
+	g_free(loc);
+
+	loc = string ? g_locale_from_utf8(string, -1, NULL, NULL, NULL) : NULL;
+
+	return loc ? loc : string;
+}
+