Changeset 22841
- Timestamp:
- 2010-09-02T14:20:00+12:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/GreenstoneXMLPlugin.pm
r17745 r22841 1 1 2 ########################################################################### 2 3 # … … 31 32 package GreenstoneXMLPlugin; 32 33 34 use Encode; 35 33 36 use ReadXMLFile; 34 37 … … 39 42 @GreenstoneXMLPlugin::ISA = ('ReadXMLFile'); 40 43 } 44 45 41 46 42 47 … … 143 148 } 144 149 elsif ($element eq "Metadata") { 145 $self->{'doc_obj'}->add_utf8_metadata($self->{'section'}, $self->{'metadata_name'},$self->{'metadata_value'}); 150 # text read in by XML::Parser is in Perl's binary byte value 151 # form ... need to explicitly make it UTF-8 152 153 my $metadata_name = decode("utf-8",$self->{'metadata_name'}); 154 my $metadata_value = decode("utf-8",$self->{'metadata_value'}); 155 156 $self->{'doc_obj'}->add_utf8_metadata($self->{'section'}, 157 $metadata_name,$metadata_value); 158 146 159 # Ensure this value is added to the allvalues database in gseditor. 147 160 # Note that the database constraints prevent multiple occurances of the … … 182 195 } 183 196 elsif ($element eq "Content" && $self->{'content'} ne "") { 184 $self->{'doc_obj'}->add_utf8_text($self->{'section'}, $self->{'content'}); 197 198 # text read in by XML::Parser is in Perl's binary byte value 199 # form ... need to explicitly make it UTF-8 200 my $content = decode("utf-8",$self->{'content'}); 201 202 $self->{'doc_obj'}->add_utf8_text($self->{'section'}, $content); 185 203 $self->{'content'} = ""; 186 204 }
Note:
See TracChangeset
for help on using the changeset viewer.