On 30.06.2017 17:13, Niemann, Hartmut wrote:
> Hello!
>
> I want to parse svn status output with a batch file on Windows 7 (and feed it back to svn diff and some other tools doing svn cat)
>
> See the attached screen shot.
>
> In plain text:
> I run
> svn status
>
> (Tortoise SVN 1.9.4 command line client) and it reports a file whose directory name contains umlauts.
> If I use the default code page 437, the path is displayed fine.
>
> I loop over the output with
> for /F "usebackq tokens=1,*" %i in (`svn status`) DO echo "%j" & dir "%j"
> and the displayed path consists of graphical glyphs, and dir won't find it.
>
> I switch to cp1252. svn status displays exactly the string seen the step before.
>
> I loop over the output with
> for /F "usebackq tokens=1,*" %i in (`svn status`) DO echo "%j" & dir "%j"
> and the filename is still displayed with weird graphics, but it is found.
>
>
> If I loop over svn status output, obviously the encoding of umlauts changes in some mysterious way to code page 1252.
> I can change the codepage to cp1252, but then the plain svn status output is garbled.
>
> What am I seeing here?
> What is the safest way to handle umlauts with svn in batch files?
Haven't tested, but changing the code page to utf8 at the start of the
batch file might work:
chcp 65001
:: your batch file content
chcp 437
Stefan
--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest interface to (Sub)version control
/_/ \_\ http://tortoisesvn.net
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3253615
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2017-07-01 11:03:28 CEST