Could anyone review this patch? This is a patch to fix a genuine
(although tiny) bug for those who use svn under locales with many
multibyte characters, such as CJK-language (ja, ko, and zh) users.
I'd like to see it fixed on 1.4.x.
> I've found a minor l10n bug and created a patch to fix it.
> Could you please review and approve to commit it?
> # Sorry for a long title; I don't know how to describe this bug shortly...
> The bug is...
> In using svn with a locale for which translation for a message " arg"
> contains non-ASCII characters, when an option taking an argument is not
> appropriate for the subcommand, an encoding error occurs like:
> nori1[17:03]% svn cat -c20043 saba:~/svnwc/subversion-trunk
> subversion/libsvn_subr/utf.c:532: (apr_err=22)
> svn: Can't convert string from native encoding to 'UTF-8':
> subversion/libsvn_subr/utf.c:530: (apr_err=22)
> svn: -c [--change] <?\229?\188?\149?\230?\149?\176>
> (Actually, the second message "Can't convert..." is localized;
> it is manually retranslated into English here :-) )
> With LC_MESSAGES=C, of course, unlocalized message is correctly displayed:
> nori1[18:08]% LC_MESSAGES=C svn cat -c20043 saba:~/svnwc/subversion-trunk
> Subcommand 'cat' doesn't accept option '-c [--change] arg'
> Type 'svn help cat' for usage.
> And in the same conditions for svnadmin, svnlook, and svnsync, which have
> both subcommands and options taking an argument, localized messages are
> correctly displayed.
> This patch makes relevant code in subversion/svn/main.c close to one for
> svnadmin, svnlook, and svnsync.
Fix an l10n encoding error for a message displayed when a svn subcommand
takes an inappropriate option taking an argument.
This bug occurs only when using svn with a locale for which translation
for a message " arg" contains non-ASCII characters. svnadmin, svnlook,
and svnsync are not affected.
(main): Don't apply svn_utf_cstring_to_utf8 to UTF-8 strings generated
by svn_opt_format_option, partly reverting r9795.
--- subversion/svn/main.c (revision 20532)
+++ subversion/svn/main.c (working copy)
@@ -1285,15 +1285,11 @@
if (! svn_opt_subcommand_takes_option2(subcommand, opt_id))
- const char *optstr, *optstr_utf8, *cmdname_utf8;
+ const char *optstr;
const apr_getopt_option_t *badopt =
svn_opt_format_option(&optstr, badopt, FALSE, pool);
- if ((err = svn_utf_cstring_to_utf8(&optstr_utf8, optstr, pool))
- || (err = svn_utf_cstring_to_utf8(&cmdname_utf8,
- subcommand->name, pool)))
- return svn_cmdline_handle_exit_error(err, pool, "svn: ");
if (subcommand->name == '-')
svn_cl__help(NULL, NULL, pool);
@@ -1301,7 +1297,7 @@
(stderr, pool, _("Subcommand '%s' doesn't accept option '%s'\n"
"Type 'svn help %s' for usage.\n"),
- cmdname_utf8, optstr_utf8, cmdname_utf8));
+ subcommand->name, optstr, subcommand->name));
To unsubscribe, e-mail: email@example.com
For additional commands, e-mail: firstname.lastname@example.org
Received on Tue Jul 11 19:33:32 2006