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

Re: Convert cmdline args to UTF-8 all at once at program start?

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: 2006-02-10 15:53:01 CET

Branko Čibej wrote:
> C. Michael Pilato wrote:
>
>> Julian Foad wrote:
>>
>>
>>> Paul Burba has just sent a patch to do native-to-UTF-8 conversion of
>>> command-line arguments right at the start of the program, before
>>> argument processing. That's because our argument processing assumes an
>>> ASCII subset for all the strings it needs to match, but he's converting
>>> from EBCDIC.
>>>
>>
>>
>> I've not seen Paul's change, but does this cause any misinteraction with
>> a commandline like:
>>
>> svn commit -m <Shift-JIS log message> --encoding Shift-JIS ...
>>
>> Seems a native-to-UTF-8 conversion of that log message is likely to fail
>> unless Shift-JIS (in this case) is the native encoding.
>>
>
> Doesn't --encoding only affect log messages pulled from files with -F? I
> can't imagine how mixed encodings on the command line would work in
> general.

How would they work? As expected, of course:

$ svnadmin create repos
$ svn mkdir file://`pwd`/repos/foo \
            -m `cat ~/misc/i18n-data/shift-jis.txt`
subversion/libsvn_subr/utf.c:555: (apr_err=22)
svn: Valid UTF-8 data
(hex: 73 68 69 66 74 2d 6a 69 73 2d)
followed by invalid UTF-8 sequence
(hex: 83 63 81 5b)
$ svn mkdir file://`pwd`/repos/foo \
            -m `cat ~/misc/i18n-data/shift-jis.txt` \
             --encoding Shift-JIS
Committed revision 1.
$ svn log file://`pwd`/repos
------------------------------------------------------------------------
r1 | cmpilato | 2006-02-10 09:50:40 -0500 (Fri, 10 Feb 2006) | 1 line

shift-jis-ツールバー
------------------------------------------------------------------------
$

-- 
C. Michael Pilato <cmpilato@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Received on Fri Feb 10 15:55:15 2006

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.