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

Re: 'svnadmin dump' is garbled on Japanese version of Windows.

From: Masaru Tsuchiyama <m.tmatma_at_gmail.com>
Date: Thu, 25 Jul 2013 21:54:17 +0900

Hi

> Which locale/encoding are you using?

I'm using "ja-jp" and ShiftJIS.

I add a code which calls GetACP() and GetUserDefaultLocaleName()
at svn_subr__win32_xlate_to_stringbuf().

GetACP() returns 932 and GetUserDefaultLocaleName() returns "ja-jp".

http://msdn.microsoft.com/en-us/library/windows/desktop/dd318070%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/dd317756%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/dd318136%28v=vs.85%29.aspx/css

> Is that UTF-8? It's certainly UTF-8 in the email.

No. It is Shift JIS.
I use UTF-8 for convenience in the mail.

> Why is svn_cmdline_cstring_from_utf8 failing?

It expects UTF8 string as the second parameter.
But the paremeter is already converted to native charset (Shift-JIS in my case)
by svn_cmdline_cstring_from_utf8() at cmdline_stream_printf()

1. svn_cmdline_cstring_from_utf8() takes Shift-JIS string as the second paremeter
    at svn_cmdline_fputs.
2. svn_cmdline_cstring_from_utf8() calls svn_utf_cstring_from_utf8().
3. svn_utf_cstring_from_utf8() calls check_cstring_utf8().
4. check_cstring_utf8() calls svn_utf__cstring_is_valid().
5. Then svn_utf__cstring_is_valid() returns 0 for Shift-JIS string.
    (Variable 'state' is 8 [FSM_ERROR])
6. check_cstring_utf8() returns APR_EINVAL.

-- 
Masaru Tsuchiyama <m.tmatma_at_gmail.com>
> Masaru Tsuchiyama <m.tmatma_at_gmail.com> writes:
> 
> > The output of 'svnadmin dump' is garbled on Japanese version of Windows.
> >
> > svnadmin>svnadmin create test
> >
> > svnadmin>svnadmin dump test > nul
> > * ?\131?\138?\131r?\131W?\131?\135?\131?\147 0 ?\130?\240?\131_?\131?\147?\131v?\130?\181?\130?\220?\130?\181?\130?\189?
> > \129B
> 
> Which locale/encoding are you using?
> 
> > svnadmin>set LANG=C
> >
> > svnadmin>svnadmin dump test > nul
> > * Dumped revision 0.
> >
> > This issue was introduced at 1485650.
> 
> r1485650 | philip | 2013-05-23 12:32:34 +0100 (Thu, 23 May 2013) | 8 lines
> 
> Convert svnadmin notifications from UTF8 to native encoding.
> 
> Reported by: QXO <qxodream{_AT_}gmail.com>
> 
> > It works fine at r1485649.
> >
> > svnadmin>svnadmin dump   test  1>nul
> > * リビジョン 0 をウ6柑ンプしました。
> >
> > The variable 'out' of cmdline_stream_printf in svnadmin.c holds 
> > the correct string "* リビジョン 0 をウ6柑ンプしました。".
> 
> Is that UTF-8?  It's certainly UTF-8 in the email.
> 
> > cmdline_stream_printf calls svn_stream_write.
> > svn_stream_write calls svn_cmdline_fputs.
> > svn_cmdline_fputs calls svn_cmdline_cstring_from_utf8 and
> > svn_cmdline_fputs calls svn_cmdline_cstring_from_utf8_fuzzy because the
> > failure of svn_cmdline_cstring_from_utf8.
> 
> Why is svn_cmdline_cstring_from_utf8 failing?
> 
> -- 
> Philip Martin | Subversion Committer
> WANdisco | Non-Stop Data
Received on 2013-07-25 14:54:58 CEST

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