summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2010-11-11 11:00:18 +0100
committerYorhel <git@yorhel.nl>2010-11-11 11:00:18 +0100
commit076408b17bc231dfab30125f2e445cd54f5227b8 (patch)
tree2808cdf66b0e5ac173f3d507ea9c66a3f0eecb32 /lib
parente66795761de0ad7b1544b8737926982e7e55898c (diff)
Util::CommonHTML:revdiff: Removed encode/decode UTF-8 pass
Algorithm::Diff::Fast can handle perl encoded UTF-8 perfectly fine, so the encode and decode functions aren't necessary anymore.
Diffstat (limited to 'lib')
-rw-r--r--lib/VNDB/Util/CommonHTML.pm8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/VNDB/Util/CommonHTML.pm b/lib/VNDB/Util/CommonHTML.pm
index 23b5b391..a862911d 100644
--- a/lib/VNDB/Util/CommonHTML.pm
+++ b/lib/VNDB/Util/CommonHTML.pm
@@ -7,7 +7,6 @@ use YAWF ':html', 'xml_escape';
use Exporter 'import';
use Algorithm::Diff::Fast 'compact_diff';
use VNDB::Func;
-use Encode 'encode_utf8', 'decode_utf8';
use POSIX 'ceil';
our @EXPORT = qw|
@@ -235,9 +234,8 @@ sub revdiff {
return if $ser1 eq $ser2;
if($o{diff} && $ser1 && $ser2) {
- # compact_diff doesn't like utf8 encoded strings, so encode input, decode output
- my @ser1 = map encode_utf8($_), $o{split} ? $o{split}->($ser1) : map xml_escape($_), split //, $ser1;
- my @ser2 = map encode_utf8($_), $o{split} ? $o{split}->($ser2) : map xml_escape($_), split //, $ser2;
+ my @ser1 = $o{split} ? $o{split}->($ser1) : map xml_escape($_), split //, $ser1;
+ my @ser2 = $o{split} ? $o{split}->($ser2) : map xml_escape($_), split //, $ser2;
return if $o{split} && $#ser1 == $#ser2 && !grep $ser1[$_] ne $ser2[$_], 0..$#ser1;
$ser1 = $ser2 = '';
@@ -249,8 +247,6 @@ sub revdiff {
$ser1 .= ($ser1?$o{join}:'').($i % 2 ? qq|<b class="diff_del">$a</b>| : $a) if $a ne '';
$ser2 .= ($ser2?$o{join}:'').($i % 2 ? qq|<b class="diff_add">$b</b>| : $b) if $b ne '';
}
- $ser1 = decode_utf8($ser1);
- $ser2 = decode_utf8($ser2);
} elsif(!$o{htmlize}) {
$ser1 = xml_escape $ser1;
$ser2 = xml_escape $ser2;