File alpine-month_name-utf8.patch of Package alpine

---
 pith/string.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

Index: alpine-2.11/pith/string.c
===================================================================
--- alpine-2.11.orig/pith/string.c
+++ alpine-2.11/pith/string.c
@@ -770,6 +770,7 @@ month_abbrev_locale(int month_num)
 	  return("xxx");
 	else{
 	    static char buf[20];
+            char *utf8buf;
 	    struct tm tm;
 
 	    memset(&tm, 0, sizeof(tm));
@@ -811,6 +812,12 @@ month_abbrev_locale(int month_num)
 
 		buf[0] = ' ';
 	    }
+            utf8buf = convert_to_utf8(buf, NULL, 0);
+            if (utf8buf != NULL) {
+                strncpy(buf, utf8buf, sizeof(buf));
+                buf[sizeof(buf)-1] = '\0';
+                fs_give((void **)&utf8buf);
+            }
 
 	    return(buf);
 	}
@@ -842,12 +849,19 @@ month_name_locale(int month_num)
 	  return("");
 	else{
 	    static char buf[20];
+            char *utf8buf;
 	    struct tm tm;
 
 	    memset(&tm, 0, sizeof(tm));
 	    tm.tm_year = 107;
 	    tm.tm_mon = month_num-1;
 	    our_strftime(buf, sizeof(buf), "%B", &tm);
+            utf8buf = convert_to_utf8(buf, NULL, 0);
+            if (utf8buf != NULL) {
+                strncpy(buf, utf8buf, sizeof(buf));
+                buf[sizeof(buf)-1] = '\0';
+                fs_give((void **)&utf8buf);
+            }
 	    return(buf);
 	}
     }
openSUSE Build Service is sponsored by