Hi,
The problem (or at least one of them) is the environment (locale) in which
svnlook utility is executed.
I did some experiments using Perl bindings for Subversion instead of calling
svnlook utility. This solves the problem for me (sending non-ascii comment
/Cyrillic/ even when post-commit script is running in POSIX locale).
I'm attaching a patch for illustration (quick and dirty one - svnlook is
still used, I'm just overwriting the log message retrieved by svnlook with
one by libsvn-perl API).
Tested on Ubuntu Linux with scmbug 2.6.19; bugzilla 3.6.1 and 3.2.7 (utf-8
enabled; backed by unicode-enabled PostgreSQL); svn 1.6.12 (via mod_svn).
I don't know whether these Perl bindings could be easily installed on
Windows.
The workaround with setting utf8 locale in the beginning of post-commit
(LANG=en_US.UTF-8) is another alternative which works for me.
/BTW - file paths may also contain non-unicode characters/.
Regards,
Yavor
2010/7/26 Kristis Makris <[email protected]>
>
> On Mon, 2010-07-26 at 12:53 +0200, Thorsten Schöning wrote:
> > Normally encode will only function properly if you already have
> > a valid UTF-8 encoded string in Perl's internal format, means with set
> > UTF-8-flag. Else it will produce garbage because Perl doesn't know
>
> If I understand correctly, you are suggesting that the decode() call is
> needed, and that we need to discover from the environment the character
> set in which the log comment was provided. Is that correct ?
>
> (meaning, we need to use 'chcp' in Windows, and LANG and LANGUAGE in
> Linux, and use the decode() call with the character set they report)
>
>
> _______________________________________________
> scmbug-users mailing list
> [email protected]
> http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users
>
>
--- Subversion.pm.org 2010-07-22 01:09:20.000000000 +0300
+++ Subversion.pm 2010-07-26 22:09:20.000000000 +0300
@@ -24,6 +24,9 @@
use Scmbug::Error;
use Scmbug::Glue::SCM;
+use SVN::Core;
+use SVN::Repos;
+use SVN::Fs;
my $SUBVERSION_ADD_TOKEN = "A";
@@ -192,6 +195,8 @@
my $line;
my $old_version;
+ my $repos = SVN::Repos::open( $svn_repository );
+
# Set the repository
$self->activity()->repository( $svn_repository );
@@ -245,6 +250,9 @@
close ( SVNLOOK_YOUNGEST );
}
+ $original_log_message = $repos->fs()->revision_prop( $old_version, "svn:log" );
+ $self->activity()->original_log_message( $original_log_message );
+
# Find the list of affected files
$logger->info( "Calling 'svnlook changed' to find the list of affected files\n" );
open ( SVNLOOK_CHANGED, "svnlook changed " . $svn_tools_argument . " $svn_txn $svn_repository |" ) || log_fatal_error( $GLUE_ERROR_CANNOT_EXECUTE_SVNLOOK_CHANGED, "Cannot execute 'svnlook changed': $!\n");
_______________________________________________
scmbug-users mailing list
[email protected]
http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users