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

Re: svnadmin upgrade output message i18n issue

From: Dongsheng Song <dongsheng.song_at_gmail.com>
Date: Thu, 23 May 2013 21:06:15 +0800

On Thu, May 23, 2013 at 4:17 PM, Philip Martin
<philip.martin_at_wandisco.com> wrote:
> [bringing in dev_at_s.a.o]
>
> QXO <qxodream_at_gmail.com> writes:
>
>> os: windows
>> encoding:GBK ( chcp 936 )
>>
>> The svnadmin upgrade command output message first line encoding
>> issue(UTF-8 show in GBK),But the second line is right encoding!
>>
>> 宸插彇寰楃増鏈簱閿佸畾銆?璇风◢鍊欙紱鍗囩骇鐗堟湰搴撳彲鑳介渶瑕佷竴娈垫椂闂?..
>>
>> 完成升级。
>>
>> if change console encoding to UTF-8 (chcp 65001),output message is :
>>
>> Repository lock acquired.
>> Please wait; upgrading the repository may take some time...
>>
>> Upgrade completed.
>
> Those two lines are produced by different code paths. The first line
> is produced by repos_notify_handler:
>
> svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
> _("Repository lock acquired.\n"
> "Please wait; upgrading the"
> " repository may take some time...\n")));
>
> The second line is produced by:
>
> SVN_ERR(svn_cmdline_printf(pool, _("\nUpgrade completed.\n")));
>
> and svn_cmdline_printf uses svn_cmdline_cstring_from_utf8 to do a UTF8
> to native conversion.
>
> So it appears the UTF8 to native conversion is missing from
> repos_notify_handler. I think repos_notify_handler should be using
> svn_stream_printf_from_utf8 rather than svn_stream_printf.
>

NO. From GETTEXT(3) man pages:

In both cases, the functions also use the LC_CTYPE locale facet in
order to convert the translated message from the translator's
codeset to the ***current locale's codeset***, unless overridden by a
prior call to the bind_textdomain_codeset function.

So svn_cmdline_printf SHOULD NOT assume the input string is UTF-8
coded, it it encoded to the ***current locale's codeset***.

--
Regards,
Dongsheng
Received on 2013-05-23 15:07:08 CEST

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.