[PATCH] Fix diff header paths with characters not representable in current code page

29 views
Skip to first unread message

Patrick Steinhardt

unread,
Sep 17, 2019, 2:25:06 AM9/17/19
to tortois...@googlegroups.com
Hi,

When creating patches for files whose path contain characters not
representable in the current locale's code page, then TortoiseSVN
will replace these characters with '?'. E.g. if you have English
set up as the current code page and a file name with Japanese
characters, then the diff header of the patch will contain an
invalid path and thus render the patch unusable.

The root issue here is that when executing `svn_client_diff7`, we
pass `APR_LOCALE_CHARSET` as the header encoding. This will cause
Subversion to use the current thread's locale, which is any one
of the ANSI code pages. As these cannot by design represent all
characters but only a limited subset, this will fail in the above
described scenario.

Fix the issue by instead specifying "UTF-8" as diff header
encoding. Like this, we are able to represent all possible paths
independent of the currently set up system locale. As Subversion
will internally convert diff header paths to UTF-8 anyway, this
is the safest bet to fix the issue without any unexpected side
effects.

Please find the attached patch, which implements the fix.

Regards
Patrick
diff-header-utf8.patch
signature.asc

Stefan

unread,
Sep 17, 2019, 1:35:26 PM9/17/19
to TortoiseSVN-dev
Thanks!
Committed in r28659

Stefan
Reply all
Reply to author
Forward
0 new messages