[Pkg-xfce-commits] r2121 - in goodies/xfce4-weather-plugin/debian: . patches

corsac at alioth.debian.org corsac at alioth.debian.org
Tue Jun 10 23:30:05 UTC 2008


Author: corsac
Date: 2008-06-10 23:30:03 +0000 (Tue, 10 Jun 2008)
New Revision: 2121

Added:
   goodies/xfce4-weather-plugin/debian/patches/01_fix-local-encodings.patch
Modified:
   goodies/xfce4-weather-plugin/debian/changelog
Log:
* debian/patches:
  - 01_fix-local-encodings added. Fix issues with non UTF8 encodings of
  dates.                                                      closes: #483952

Modified: goodies/xfce4-weather-plugin/debian/changelog
===================================================================
--- goodies/xfce4-weather-plugin/debian/changelog	2008-06-09 15:45:49 UTC (rev 2120)
+++ goodies/xfce4-weather-plugin/debian/changelog	2008-06-10 23:30:03 UTC (rev 2121)
@@ -1,3 +1,11 @@
+xfce4-weather-plugin (0.6.2-2) UNRELEASED; urgency=low
+
+  * debian/patches:
+    - 01_fix-local-encodings added. Fix issues with non UTF8 encodings of
+    dates.                                                      closes: #483952
+
+ -- Yves-Alexis Perez <corsac at debian.org>  Wed, 11 Jun 2008 00:54:39 +0200
+
 xfce4-weather-plugin (0.6.2-1) unstable; urgency=low
 
   [ Simon Huggins ]

Added: goodies/xfce4-weather-plugin/debian/patches/01_fix-local-encodings.patch
===================================================================
--- goodies/xfce4-weather-plugin/debian/patches/01_fix-local-encodings.patch	                        (rev 0)
+++ goodies/xfce4-weather-plugin/debian/patches/01_fix-local-encodings.patch	2008-06-10 23:30:03 UTC (rev 2121)
@@ -0,0 +1,77 @@
+diff --git a/tags/0.6.2/panel-plugin/weather-translate.c b/tags/0.6.2/panel-plugin/weather-translate.c
+index 3ceb2f8..5742371 100644
+--- panel-plugin/weather-translate.c
++++ panel-plugin/weather-translate.c
+@@ -330,11 +330,18 @@ translate_lsup (const gchar *lsup)
+ 
+   if (mktime (&time) != -1)
+     {
++      int len;
+       hdate = g_malloc (HDATE_N);
++      gchar *utf8time = NULL;
+ 
+-      strftime (hdate, HDATE_N, _("%x at %X Local Time"), &time);
++      len = strftime (hdate, HDATE_N, _("%x at %X Local Time"), &time);
++      hdate[len] = '\0';
++      utf8time = g_locale_to_utf8(hdate, -1, NULL, NULL, NULL);
++      if (utf8time == NULL)
++        return g_strdup(_("Error"));
+ 
+-      return hdate;
++      g_free(hdate);
++      return utf8time;
+     }
+   else
+     return NULL;
+@@ -362,13 +369,22 @@ translate_day (const gchar *day)
+     return NULL;
+   else
+     {
++      int len;
++      gchar *utf8day = NULL;
++
+       time.tm_wday = wday;
+ 
+       day_loc = g_malloc (DAY_LOC_N);
+ 
+-      strftime (day_loc, DAY_LOC_N, "%A", &time);
++      len = strftime (day_loc, DAY_LOC_N, "%A", &time);
++      day_loc[len] = '\0';
++      utf8day = g_locale_to_utf8(day_loc, -1, NULL, NULL, NULL);
++
++      if (utf8day == NULL)
++        return g_strdup(_("Error"));
+ 
+-      return day_loc;
++      g_free(day_loc);
++      return utf8day;
+     }
+ }
+ 
+@@ -444,6 +460,8 @@ translate_time (const gchar *time)
+   gchar     **time_split, *time_loc;
+   gint        i = 0, size = 0;
+   struct tm   time_tm;
++  int         len;
++  gchar      *utf8time = NULL;
+ 
+   if (strlen (time) == 0)
+     return NULL;
+@@ -461,9 +479,15 @@ translate_time (const gchar *time)
+   _fill_time (&time_tm, time_split[0], time_split[1], time_split[2]);
+   g_strfreev (time_split);
+ 
+-  strftime (time_loc, TIME_LOC_N, "%X", &time_tm);
++  len = strftime (time_loc, TIME_LOC_N, "%X", &time_tm);
++  time_loc[len] = '\0';
++  utf8time = g_locale_to_utf8(time_loc, -1, NULL, NULL, NULL);
++
++  if (utf8time == NULL)
++    return g_strdup(_("Error"));
+ 
+-  return time_loc;
++  g_free(time_loc);
++  return utf8time;
+ }
+ 
+ 




More information about the Pkg-xfce-commits mailing list