- changed 5 files
For issue #2487, "mod_dav_svn and locales fail to play nicely together",add a new configuration option which allows Subversion libraries calledfrom mod_dav_svn to process UTF-8 strings, instead of just ASCII strings.Because httpd is not locale-aware, we cannot assume that a native characterset other than ASCII is present in the environment that mod_dav_svn runs in.UTF-8 is backward compatible to ASCII, and all paths within Subversionrepositories are already encoded in UTF-8. Thus, we can safely allow UTF-8without running into character set conversion issues in code called frommod_dav_svn.Basic testing shows that httpd is prepared to tolerate non-ASCII characters,even though it doesn't seem to interpret them. E.g. it logs such charactersas hex codes preceded by a backslash.The new configuration option is called SVNUseUTF8 and can be set to"On" or "Off" (the default is "Off"). It is a global option that takeseffect for all repository locations defined in the configuration file.When the option is "On", files that contain UTF-8 characters in theirnames can be processed by the pre-lock hook, hooks are able to writeUTF-8 characters to stdout and stderr, and filesystem paths to Subversionrepositories may contain UTF-8 characters.* subversion/mod_dav_svn/mod_dav_svn.c (server_conf_t): Add use_utf8 boolean. (init): Initialise the native character set of Subversion's UTF-8 conversion routines to either ASCII (default) or UTF-8. (SVNUseUTF8_cmd): New option command processor. (cmds): Add new "SVNUseUTF8" option.* subversion/include/svn_utf.h (svn_utf_initialize2): Declare. Includes the ablity to force the native character set to UTF-8, regardless of locale. (svn_utf_initialize): Deprecate.* subversion/libsvn_subr/deprecated.c (svn_utf_initialize): Re-implement as wrapper around svn_utf_initialize2().* subversion/libsvn_subr/cmdline.c (svn_cmdline_init): Update funtion call to svn_utf_initialize2(), keeping the native character set based on the current locale.* subversion/libsvn_subr/utf.c (svn_utf_initialize2): New. (assume_native_charset_is_utf8): New global boolean variable. Defaults to FALSE, and may be set to TRUE by svn_utf_initialize2() (which, like its predecessor, is documented to not be thread-safe). (get_ntou_xlate_handle_node, get_uton_xlate_handle_node): If the native character set has been forced to UTF-8, use SVN_APR_UTF8_CHARSET instead of SVN_APR_LOCALE_CHARSET.