* subversion/libsvn_subr/time.c:
(svn_time_to_human_cstring) Despite its name (cstring) it is needed
that this function return an UTF8 string. So there's the need to
convert
the human-readable part, which can come encoded in the current
locale's charset.
Index: subversion/libsvn_subr/time.c
===================================================================
--- subversion/libsvn_subr/time.c (revision 9284)
+++ subversion/libsvn_subr/time.c (working copy)
@@ -226,7 +226,7 @@
apr_time_exp_t exploded_time;
apr_size_t len, retlen;
apr_status_t ret;
- char *datestr, *curptr;
+ char *datestr, *curptr, human_datestr[SVN_TIME__MAX_LENGTH];
/* Get the time into parts */
apr_time_exp_lt (&exploded_time, when);
@@ -255,7 +255,7 @@
curptr = datestr + len;
/* Put in human explanatory part */
- ret = apr_strftime (curptr,
+ ret = apr_strftime (human_datestr,
&retlen,
SVN_TIME__MAX_LENGTH - len,
human_timestamp_format_suffix,
@@ -264,7 +264,22 @@
/* If there was an error, ensure that the string is zero-terminated. */
if (ret || retlen == 0)
*curptr = '\0';
+ else
+ {
+ char *utf8_string;
+ svn_error_t *err;
+ err = svn_utf_cstring_to_utf8(&utf8_string, human_datestr, pool);
+ if(err)
+ {
+ *curptr = '\0';
+ } else
+ {
+ strncpy(curptr, utf8_string, SVN_TIME__MAX_LENGTH - len);
+ curptr[SVN_TIME__MAX_LENGTH - len] = '\0';
+ }
+ }
+
return datestr;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Apr 4 20:35:25 2004