/[wait]/cvs-head/lib/WAIT/Document/Ora.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 /cvs-head/lib/WAIT/Document/Ora.pm

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

revision 74 by laperla, Fri Mar 8 21:18:51 2002 UTC revision 76 by laperla, Sat Apr 6 19:00:54 2002 UTC
# Line 13  Line 13 
13  #  #
14    
15  package WAIT::Document::Ora;  package WAIT::Document::Ora;
16  @ISA = qw(WAIT::Document::Base);  use base qw(WAIT::Document::Base);
 use WAIT::Document::Base;  
17    
18  use IO::File;  use IO::File;
19  use Encode;  use Encode;
# Line 51  sub FETCH { Line 50  sub FETCH {
50    
51    local($/) = undef;    local($/) = undef;
52    
53    return {    my $ret = {};
54            desc => $self->conv_getline("$id/desc.html"),    my @p = qw(
55            author => $self->conv_getline("$id/author.html"),  author
56            index => $self->conv_getline("$id/index.html"),  colophon
57            colophon => $self->conv_getline("$id/colophon.html"),  desc
58            translator => $self->conv_getline("$id/translator.html"),  index
59            toc => $self->conv_getline("$id/toc.html"),  inx
60            inx => $self->conv_getline("$id/inx.html"),  toc
61           };  translator
62    );
63      push @p, "chapter" if oreilly_de_catalog::config::WITH_CHAPTER();
64      for my $p (@p) {
65        my $file = $p eq "chapter" ? "chapter/index" : $p;
66        $ret->{$p} = $self->conv_getline("$id/$file.html");
67      }
68      return $ret;
69  }  }
70    
71  # WAIT::Document::Ora::conv_getline  # WAIT::Document::Ora::conv_getline
# Line 82  sub conv_getline { Line 88  sub conv_getline {
88    seek $fh, 0, 0;    seek $fh, 0, 0;
89    undef $/;    undef $/;
90    my $content = <$fh>;    my $content = <$fh>;
91      close $fh;
92    $content =~ s/\s+/ /gs; # eliminate TABs and CRs for easier debugging    $content =~ s/\s+/ /gs; # eliminate TABs and CRs for easier debugging
93    my $dcontent = Encode::decode($src_enc,$content);    my $dcontent = Encode::decode($src_enc,$content);
94      unless (utf8::valid($dcontent)) {
95        warn "utf8 says invalid";
96      }
97      unless (Encode::is_utf8($dcontent)) {
98        warn "Encode says this isn't utf8";
99      }
100    $dcontent;    $dcontent;
101  }  }
102    

Legend:
Removed from v.74  
changed lines
  Added in v.76

  ViewVC Help
Powered by ViewVC 1.1.26