/[webpac2]/trunk/lib/WebPAC/Output/Estraier.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/WebPAC/Output/Estraier.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 75 by dpavlin, Sun Nov 20 20:32:41 2005 UTC revision 85 by dpavlin, Tue Nov 22 08:27:53 2005 UTC
# Line 92  sub new { Line 92  sub new {
92          $log->info("using encoding $encoding");          $log->info("using encoding $encoding");
93    
94          $self->{'iconv'} = new Text::Iconv($encoding, 'UTF-8') or          $self->{'iconv'} = new Text::Iconv($encoding, 'UTF-8') or
95                  $log->die("can't create conversion from $encoding to UTF-8");                  $log->logdie("can't create conversion from $encoding to UTF-8");
96    
97          $self ? return $self : return undef;          $self ? return $self : return undef;
98  }  }
# Line 160  sub add { Line 160  sub add {
160                  $log->logconfess("no values for $tag/$type") unless ($vals);                  $log->logconfess("no values for $tag/$type") unless ($vals);
161    
162                  $vals = $self->{'iconv'}->convert( $vals ) or                  $vals = $self->{'iconv'}->convert( $vals ) or
163                          $log->die("can't convert '$vals' to UTF-8");                          $log->logdie("can't convert '$vals' to UTF-8");
164    
165                  $doc->add_attr( $tag, $vals );                  $doc->add_attr( $tag, $vals );
166                  $doc->add_hidden_text( $vals );                  $doc->add_hidden_text( $vals );
# Line 169  sub add { Line 169  sub add {
169          my $text = $args->{'text'};          my $text = $args->{'text'};
170          if ( $text ) {          if ( $text ) {
171                  $text = $self->{'iconv'}->convert( $text ) or                  $text = $self->{'iconv'}->convert( $text ) or
172                          $log->die("can't convert '$text' to UTF-8");                          $log->logdie("can't convert '$text' to UTF-8");
173                  $doc->add_text( $text );                  $doc->add_text( $text );
174          }          }
175    
176          $log->debug("adding ", sub { $doc->dump_draft } );          $log->debug("adding ", sub { $doc->dump_draft } );
177          $self->{'db'}->put_doc($doc) || $log->die("can't add document $uri to index");          $self->{'db'}->put_doc($doc) || $log->logdie("can't add document $uri to index");
178    
179          return 1;          return 1;
180  }  }

Legend:
Removed from v.75  
changed lines
  Added in v.85

  ViewVC Help
Powered by ViewVC 1.1.26