Discussion:
mod_dav_svn SVNUseUTF8 option not working
Dmitry Bakshaev
2018-10-25 18:27:22 UTC
Permalink
my subversion server is apache-2.4.34/event-MPM and
subversion-1.9.7/mod_dav_svn

configuration based on example from
https://subversion.apache.org/docs/release-notes/1.8.html#hooks

cat httpd.conf:
SVNHooksEnv /etc/subversion/svnserve.conf
SVNUseUTF8 On #not "yes" as example say

cat /etc/subversion/svnserve.conf:
[default]
LANG = ru_RU.UTF-8

cat pre-commit:
#!/bin/sh
echo "Привет" >&2

pre-commit hook failed with message:
[Error output could not be translated from the native
locale to UTF-8.]

this bug is https://issues.apache.org/jira/browse/SVN-2487
related.

after some tracing of mod_dav_svn i find
call to svn_utf_initialize2() from init()
always does with conf->use_utf8=0.

adding svn_utf_initialize2() to merge_server_config()
fixes the problem.

patch attached.

--- subversion/mod_dav_svn/mod_dav_svn.c.orig<->2018-10-25
16:44:12.388287364 +0400
+++ subversion/mod_dav_svn/mod_dav_svn.c<------>2018-10-25
16:43:55.958287555 +0400
@@ -231,6 +231,8 @@
newconf->compression_level =
child->compression_level;
}
.
+ newconf->use_utf8 = INHERIT_VALUE(parent, child,
use_utf8);
+ svn_utf_initialize2(newconf->use_utf8, p);
return newconf;
}
.
Stefan Sperling
2018-10-26 10:07:47 UTC
Permalink
Post by Dmitry Bakshaev
my subversion server is apache-2.4.34/event-MPM and
subversion-1.9.7/mod_dav_svn
configuration based on example from
https://subversion.apache.org/docs/release-notes/1.8.html#hooks
SVNHooksEnv /etc/subversion/svnserve.conf
SVNUseUTF8 On #not "yes" as example say
[default]
LANG = ru_RU.UTF-8
While this will work, svnserve.conf isn't a good place for setting hook
script environment variables because this path is the configuration
file of the 'svnserve' program.
I'd suggest using a different path, such as '/etc/subversion/hooks-env'.
Post by Dmitry Bakshaev
#!/bin/sh
echo "Привет" >&2
[Error output could not be translated from the native locale to UTF-8.]
this bug is https://issues.apache.org/jira/browse/SVN-2487 related.
after some tracing of mod_dav_svn i find
call to svn_utf_initialize2() from init()
always does with conf->use_utf8=0.
adding svn_utf_initialize2() to merge_server_config() fixes the problem.
patch attached.
--- subversion/mod_dav_svn/mod_dav_svn.c.orig<->2018-10-25
16:44:12.388287364 +0400
+++ subversion/mod_dav_svn/mod_dav_svn.c<------>2018-10-25
16:43:55.958287555 +0400
@@ -231,6 +231,8 @@
newconf->compression_level = child->compression_level;
}
.
+ newconf->use_utf8 = INHERIT_VALUE(parent, child, use_utf8);
+ svn_utf_initialize2(newconf->use_utf8, p);
return newconf;
}
.
Thanks, committed in https://svn.apache.org/r1844882 and nominated
for backport to 1.10.x.

Loading...