diff options
author | mkanat%bugzilla.org <> | 2009-02-20 21:55:10 +0000 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2009-02-20 21:55:10 +0000 |
commit | 102696172b97d4dccd7669a2dc05a2f3c71ab1f7 (patch) | |
tree | fdc72fb4a424fc5530729c61cebf9c1edf46ebfd | |
parent | Bug 479228: Duplicated words in the error message in importxml.pl when the de... (diff) | |
download | bugzilla-102696172b97d4dccd7669a2dc05a2f3c71ab1f7.tar.gz bugzilla-102696172b97d4dccd7669a2dc05a2f3c71ab1f7.tar.bz2 bugzilla-102696172b97d4dccd7669a2dc05a2f3c71ab1f7.zip |
Bug 431201: recode.pl crash when trying to convert 2.16 database to 3.0.3 schema
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=mkanat
-rwxr-xr-x | contrib/recode.pl | 16 |
1 files changed, 6 insertions, 10 deletions
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 <<EOT; Using --guess requires that Encode::Detect be installed. To install -Encode::Detect, first download it from: +Encode::Detect, run the following command: - http://search.cpan.org/dist/Encode-Detect/ - -Then, unpack it into its own directory and run the following commands -in that directory, as $root: - - ./Build.PL - ./Build - ./Build install + $^X install-module.pl Encode::Detect EOT exit; @@ -248,7 +241,10 @@ foreach my $table ($dbh->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 |