diff options
author | Suresh Chandrasekharan <suresh.chandrasekharan@sun.com> | 2003-08-21 10:23:16 +0800 |
---|---|---|
committer | Suresh Chandrasekharan <kcsuresh@src.gnome.org> | 2003-08-21 10:23:16 +0800 |
commit | e9d518e362ce8b273d4b2281c92b77cee16b5d97 (patch) | |
tree | 4f2bba0b549eb92d2ad2969e31b7dba34b30b933 /e-util | |
parent | 8d6bc9e331468a7da3f9ea32fc1d1a2f34a7ffe1 (diff) | |
download | gsoc2013-evolution-e9d518e362ce8b273d4b2281c92b77cee16b5d97.tar gsoc2013-evolution-e9d518e362ce8b273d4b2281c92b77cee16b5d97.tar.gz gsoc2013-evolution-e9d518e362ce8b273d4b2281c92b77cee16b5d97.tar.bz2 gsoc2013-evolution-e9d518e362ce8b273d4b2281c92b77cee16b5d97.tar.lz gsoc2013-evolution-e9d518e362ce8b273d4b2281c92b77cee16b5d97.tar.xz gsoc2013-evolution-e9d518e362ce8b273d4b2281c92b77cee16b5d97.tar.zst gsoc2013-evolution-e9d518e362ce8b273d4b2281c92b77cee16b5d97.zip |
Removed illegal '-'s from strptime msgstr, this fixes #43558, Appointment
2003-08-20 Suresh Chandrasekharan <suresh.chandrasekharan@sun.com>
* zh_CN.po: Removed illegal '-'s from strptime msgstr, this fixes
#43558, Appointment Editor always gives time validation error for
apptmnts in non UTF-8/non ASCII locales.
svn path=/trunk/; revision=22323
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/ChangeLog | 6 | ||||
-rw-r--r-- | e-util/e-time-utils.c | 21 |
2 files changed, 23 insertions, 4 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 8c40628977..7cea6d5a32 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,9 @@ +2003-08-20 Suresh Chandrasekharan <suresh.chandrasekharan@sun.com> + + * e-time-utils.c (parse_with_strptime): Fixes #43558 Appointment + Editor always gives time validation error for apptmnts in non + UTF-8/non ASCII locales. + 2003-08-11 Not Zed <NotZed@Ximian.com> * e-msgport.c (e_thread_put): check pthread_create return code diff --git a/e-util/e-time-utils.c b/e-util/e-time-utils.c index 43dc249efd..8f05427a81 100644 --- a/e-util/e-time-utils.c +++ b/e-util/e-time-utils.c @@ -17,6 +17,7 @@ #include <time.h> #include <sys/time.h> +#include <gal/widgets/e-unicode.h> #ifdef __linux__ #undef _GNU_SOURCE @@ -58,6 +59,9 @@ static ETimeParseStatus parse_with_strptime (const char *value, struct tm *result, const char **formats, int n_formats) { const char *parse_end = NULL, *pos; + gchar *locale_str; + gchar *format_str; + ETimeParseStatus parse_ret; gboolean parsed = FALSE; int i; @@ -66,8 +70,10 @@ parse_with_strptime (const char *value, struct tm *result, const char **formats, result->tm_isdst = -1; return E_TIME_PARSE_NONE; } + + locale_str = e_utf8_to_locale_string (value); - pos = value; + pos = (const char *) locale_str; /* Skip whitespace */ while (isspace (*pos)) @@ -77,7 +83,9 @@ parse_with_strptime (const char *value, struct tm *result, const char **formats, for (i = 0; i < n_formats; i++) { memset (result, 0, sizeof (*result)); - parse_end = strptime (pos, formats[i], result); + format_str = e_utf8_to_locale_string (formats[i]); + parse_end = strptime (pos, format_str, result); + g_free (format_str); if (parse_end) { parsed = TRUE; break; @@ -86,6 +94,8 @@ parse_with_strptime (const char *value, struct tm *result, const char **formats, result->tm_isdst = -1; + parse_ret = E_TIME_PARSE_INVALID; + /* If we parsed something, make sure we parsed the entire string. */ if (parsed) { /* Skip whitespace */ @@ -93,10 +103,13 @@ parse_with_strptime (const char *value, struct tm *result, const char **formats, parse_end++; if (*parse_end == '\0') - return E_TIME_PARSE_OK; + parse_ret = E_TIME_PARSE_OK; } - return E_TIME_PARSE_INVALID; + g_free (locale_str); + + return (parse_ret); + } |