[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Repaired: "$Date$" Keywords always expand with their UTF-8 content, when the localized date contains non-ascii characters

From: Hanjy <hanjingyu_at_gmail.com>
Date: 2005-12-05 23:04:19 CET

I repaired it in current trunk, and 1.2.3 tags

Open file libsvn_subr/subst.c, find the:====================

        case 'D': /* long format of date of this revision */
          if (date)
            svn_stringbuf_appendcstr (value,
                                      svn_time_to_human_cstring (date,
pool));
          break;

replace the lines: ====================

            svn_stringbuf_appendcstr (value,
                                      svn_time_to_human_cstring (date,
pool));

with ====================

            {
              const char human_timestamp_weekday_names [7][4] =
                {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
              const char human_timestamp_month_names [12][4] =
                {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
                 "Sep", "Oct", "Nov", "Dec"};

              apr_time_exp_t exploded_time;
              const char *human;

              apr_time_exp_lt (&exploded_time, date);

              human = apr_psprintf (pool,
                                    "%04d-%02d-%02d %02d:%02d:%02d %+03d%02d
(%s, %.2d %s %.4d)",
                                    exploded_time.tm_year + 1900,
                                    exploded_time.tm_mon + 1,
                                    exploded_time.tm_mday,
                                    exploded_time.tm_hour,
                                    exploded_time.tm_min,
                                    exploded_time.tm_sec,
                                    exploded_time.tm_gmtoff / (60 * 60),
                                    (abs (exploded_time.tm_gmtoff) / 60) %
60,

human_timestamp_weekday_names[exploded_time.tm_wday],
                                    exploded_time.tm_mday,

human_timestamp_month_names[exploded_time.tm_mon],
                                    exploded_time.tm_year + 1900);

              svn_stringbuf_appendcstr (value, human);
            }

the result: ====================

        case 'D': /* long format of date of this revision */
          if (date)
            {
              const char human_timestamp_weekday_names [7][4] =
                {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
              const char human_timestamp_month_names [12][4] =
                {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
                 "Sep", "Oct", "Nov", "Dec"};

              apr_time_exp_t exploded_time;
              const char *human;

              apr_time_exp_lt (&exploded_time, date);

              human = apr_psprintf (pool,
                                    "%04d-%02d-%02d %02d:%02d:%02d %+03d%02d
(%s, %.2d %s %.4d)",
                                    exploded_time.tm_year + 1900,
                                    exploded_time.tm_mon + 1,
                                    exploded_time.tm_mday,
                                    exploded_time.tm_hour,
                                    exploded_time.tm_min,
                                    exploded_time.tm_sec,
                                    exploded_time.tm_gmtoff / (60 * 60),
                                    (abs (exploded_time.tm_gmtoff) / 60) %
60,

human_timestamp_weekday_names[exploded_time.tm_wday],
                                    exploded_time.tm_mday,

human_timestamp_month_names[exploded_time.tm_mon],
                                    exploded_time.tm_year + 1900);

              svn_stringbuf_appendcstr (value, human);
            }
          break;

====================
save it, re-build.

For TortoiseSVN, check out it, change the file:

/ext/Subversion/subversion/libsvn_subr/subst.c
and
/ext/Subversion/subversion/libsvn_subr/.svn/text-base/subst.c-base

then re-build it.
Received on Mon Dec 5 23:09:57 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.