[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: "200 OK" error caused by non-ASCII characters?

From: Dag-Erling Smørgrav <des_at_des.no>
Date: Mon, 19 Oct 2009 00:17:15 +0200

Fixed with the attached script. It expects two arguments: the character
set to convert from and the repo URL, so in this case:

% perl -w svn-log-iconv.pl iso-8859-1 http://svn.des.no/svn/openpam

(except it's not actually writable over http)

DES

-- 
Dag-Erling Smørgrav - des_at_des.no
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2408744
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].

#!/usr/bin/perl -w
#-
# Copyright (c) 2009 Dag-Erling Coïdan Smørgrav
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer
# in this position and unchanged.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $Id$
#

use strict;
use warnings;

use SVN::Ra;
use Text::Iconv;

my ($charset, $url) = @ARGV;

my $iconv = new Text::Iconv($charset, 'utf-8');
print(STDERR $url);
my $svn = SVN::Ra->new($url);
my $lastrev = $svn->get_latest_revnum();
for (my $rev = 1; $rev <= $lastrev; ++$rev) {
    print(STDERR " r$rev");
    my $log = $svn->rev_prop($rev, 'svn:log');
    $log =~ s/\\(\d+)/chr(oct($1))/eg;
    $log = $iconv->convert($log);
    $svn->change_rev_prop($rev, 'svn:log', $log);
}
print(STDERR "\n");

1;
Received on 2009-10-19 00:18:01 CEST

This is an archived mail posted to the Subversion Users mailing list.