From 90ae4269f6b8b528e45fe8aee3fa6f5d0b1f102b Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Fri, 20 Feb 2009 21:54:16 +0000 Subject: Bug 431201: recode.pl crash when trying to convert 2.16 database to 3.0.3 schema Patch By Max Kanat-Alexander r=LpSolit, a=mkanat --- contrib/recode.pl | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'contrib') diff --git a/contrib/recode.pl b/contrib/recode.pl index 713465be7..f7ba034ac 100755 --- a/contrib/recode.pl +++ b/contrib/recode.pl @@ -149,16 +149,9 @@ if ($switch{'guess'}) { my $root = ROOT_USER; print STDERR <bz_table_list_real) { while (my @result = $sth->fetchrow_array) { my $data = shift @result; - my $digest = md5_base64($data); + # Wide characters cause md5_base64() to die. + my $digest_data = utf8::is_utf8($data) + ? Encode::encode_utf8($data) : $data; + my $digest = md5_base64($digest_data); my @primary_keys = reverse split(',', $pk); # We copy the array so that we can pop things from it without -- cgit v1.2.3-24-g4f1b