--- gnome-applets-2.10.1/stickynotes/util.c 2005-03-20 16:10:43.000000000 +0530
+++ gnome-applets-2.10.1-new/stickynotes/util.c 2005-05-11 12:23:11.257295000 +0530
@@ -38,6 +38,11 @@ gchar * get_current_date(const gchar *fo
gint date_length = 10;
gchar *date = g_new(gchar, date_length);
+ gchar *end_valid = NULL;
+ gsize bytes_read = 0;
+ gsize bytes_written = 0;
+ gchar *date_utf8 = NULL;
+
do
{
date_length += 5;
@@ -45,6 +50,15 @@ gchar * get_current_date(const gchar *fo
}
while(strftime(date, date_length, format, current) == 0);
+ if (g_utf8_validate (date, -1, &end_valid) == FALSE) {
+ date_utf8 = g_locale_to_utf8 (date, -1, &bytes_read, &bytes_written, NULL);
+ if (date_utf8) {
+ g_free (date);
+ return date_utf8;
+ } else
+ return date;
+ }
+
return date;
}