From 64efb17d59a67ce853a4f3cd37db13306d77c088 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sat, 22 Feb 2003 13:22:09 +0000 Subject: [PATCH] use Text::Iconv for conversions git-svn-id: file:///home/dpavlin/private/svn/webpac/trunk@14 13eb9ef6-21d5-0310-b721-a9d68796d827 --- WebPac.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/WebPac.pm b/WebPac.pm index 51e6b05..11e2b27 100644 --- a/WebPac.pm +++ b/WebPac.pm @@ -6,7 +6,7 @@ use strict; use HTML::Pager; use HTML::FillInForm; use SWISH; -use Unicode::MapUTF8 qw(to_utf8 from_utf8 utf8_supported_charset); +use Text::Iconv; use DBI; use lib '..'; @@ -22,6 +22,9 @@ my $INDEX = '/data/webpac/index/isis.index'; my $MAX_HITS = 500; my $ON_PAGE = 10; +Text::Iconv->raise_error(1); # Conversion errors raise exceptions + +my $from_utf8 = Text::Iconv->new('UTF8', $CHARSET); sub setup { my $self = shift; @@ -105,8 +108,8 @@ sub show_results_list { push @swish_results, { nr => ($#swish_results + 2), path => $hit->swishdocpath, - headline => from_utf8({ -string => $hit->headline, -charset => $CHARSET }), - html => back2html(from_utf8({ -string => $hit->html, -charset => $CHARSET })), + headline => $from_utf8->convert($hit->headline), + html => back2html($from_utf8->convert($hit->html)), rank => $hit->swishrank }; }, -- 2.20.1