[PATCH] Fix encoding bug of 'svnserve -h' (was: [PATCH] svnserve -h)
From: Kobayashi Noritada <nori1_at_dolphin.c.u-tokyo.ac.jp>
Date: 2004-11-05 09:44:57 CET
Hi,
Sorry...
-----
svnserve -h displayed as follows in my Japanese environment.
nori1[14:59]% svnserve -h saba:~/subversion-1.1.1/subversion/svnserve
Valid options:
Provided LANG=C, it displayed correctly.
This was a part of issue #1997.
* subversion/svnserve/main.c uses fprintf, which do not recode UTF-8 string,
So, I created a patch and made sure it works in my Japanese environment.
Thanks in advance,
-- |: Noritada KOBAYASHI |: Dept. of General Systems Studies, |: Graduate School of Arts and Sciences, Univ. of Tokyo |: E-mail: nori1@dolphin.c.u-tokyo.ac.jp (preferable) |: nori@esa.c.u-tokyo.ac.jp Log: Fix encoding bug of 'svnserve -h', which is part of issue #1997. * subversion/svnserve/main.c (help): Use svn_cmdline_fprintf, which does UTF8->locale conversions, instead of fprintf because svn_opt_format_option localizes the documentation strings of options when formatting, even if these strings are not marked with N_(). * subversion/include/svn_opt.h (svn_opt_format_option): Add notes so that everyone may notice that this function localizes the documentation strings of options. Index: subversion/include/svn_opt.h =================================================================== --- subversion/include/svn_opt.h (revision 11748) +++ subversion/include/svn_opt.h (working copy) @@ -139,6 +139,9 @@ /** * Print an option @a opt nicely into a @a string allocated in @a pool. * If @a doc is set, include the generic documentation string of option. + * + * When you write @a string to stdout/stderr, note that the documentation + * string is localized even if it is not marked with N_() in its definition. */ void svn_opt_format_option (const char **string, Index: subversion/svnserve/main.c =================================================================== --- subversion/svnserve/main.c (revision 11748) +++ subversion/svnserve/main.c (working copy) @@ -142,7 +142,7 @@ { const char *optstr; svn_opt_format_option(&optstr, svnserve__options + i, TRUE, pool); - fprintf(stdout, " %s\n", optstr); + svn_error_clear (svn_cmdline_fprintf(stdout, pool, " %s\n", optstr)); } fprintf(stdout, "\n"); exit(1); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org For additional commands, e-mail: dev-help@subversion.tigris.orgReceived on Fri Nov 5 09:45:16 2004 |
This is an archived mail posted to the Subversion Dev mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.