View | Details | Raw Unified | Return to bug 24827
Collapse All | Expand All

(-)a/C4/Biblio.pm (-1 / +1 lines)
Lines 1158-1164 sub GetMarcBiblio { Link Here
1158
1158
1159
    if ($marcxml) {
1159
    if ($marcxml) {
1160
        $record = eval {
1160
        $record = eval {
1161
            MARC::Record::new_from_xml( $marcxml, "utf8",
1161
            MARC::Record::new_from_xml( $marcxml, "UTF-8",
1162
                C4::Context->preference('marcflavour') );
1162
                C4::Context->preference('marcflavour') );
1163
        };
1163
        };
1164
        if ($@) { warn " problem with :$biblionumber : $@ \n$marcxml"; }
1164
        if ($@) { warn " problem with :$biblionumber : $@ \n$marcxml"; }
(-)a/C4/ImportBatch.pm (-1 / +1 lines)
Lines 204-210 sub EmbedItemsInImportBiblio { Link Here
204
    |, { Slice => {} }, $import_record_id );
204
    |, { Slice => {} }, $import_record_id );
205
    my @item_fields;
205
    my @item_fields;
206
    for my $import_item ( @$import_items ) {
206
    for my $import_item ( @$import_items ) {
207
        my $item_marc = MARC::Record::new_from_xml($import_item->{marcxml});
207
        my $item_marc = MARC::Record::new_from_xml($import_item->{marcxml}, 'UTF-8');
208
        push @item_fields, $item_marc->field($itemtag);
208
        push @item_fields, $item_marc->field($itemtag);
209
    }
209
    }
210
    $record->append_fields(@item_fields);
210
    $record->append_fields(@item_fields);
(-)a/Koha/Biblio/Metadata.pm (-1 / +1 lines)
Lines 67-73 sub record { Link Here
67
    my $record;
67
    my $record;
68
68
69
    if ( $self->format eq 'marcxml' ) {
69
    if ( $self->format eq 'marcxml' ) {
70
        $record = eval { MARC::Record::new_from_xml( $self->metadata, 'utf-8', $self->schema ); };
70
        $record = eval { MARC::Record::new_from_xml( $self->metadata, 'UTF-8', $self->schema ); };
71
        my $marcxml_error = $@;
71
        my $marcxml_error = $@;
72
        chomp $marcxml_error;
72
        chomp $marcxml_error;
73
        unless ($record) {
73
        unless ($record) {
(-)a/Koha/BiblioUtils/Iterator.pm (-1 / +1 lines)
Lines 95-101 sub next { Link Here
95
    return if !$row;
95
    return if !$row;
96
    my $marcxml = C4::Biblio::GetXmlBiblio( $row->get_column('biblionumber') );
96
    my $marcxml = C4::Biblio::GetXmlBiblio( $row->get_column('biblionumber') );
97
    if ( $marcxml ) {
97
    if ( $marcxml ) {
98
        $marc = MARC::Record->new_from_xml( $marcxml );
98
        $marc = MARC::Record->new_from_xml( $marcxml, 'UTF-8' );
99
    }
99
    }
100
    else {
100
    else {
101
        confess "No marcxml column returned in the request.";
101
        confess "No marcxml column returned in the request.";
(-)a/misc/batchRebuildBiblioTables.pl (-1 / +1 lines)
Lines 63-69 while (my ($biblionumber, $frameworkcode) = $sth->fetchrow) { Link Here
63
63
64
    $marcxml = C4::Charset::StripNonXmlChars( $marcxml );
64
    $marcxml = C4::Charset::StripNonXmlChars( $marcxml );
65
    my $record = eval {
65
    my $record = eval {
66
        MARC::Record::new_from_xml($marcxml, 'utf8', $marcflavour);
66
        MARC::Record::new_from_xml($marcxml, 'UTF-8', $marcflavour);
67
    };
67
    };
68
    if ($@) {
68
    if ($@) {
69
        push @errors, $biblionumber;
69
        push @errors, $biblionumber;
(-)a/misc/migration_tools/build_oai_sets.pl (-1 / +1 lines)
Lines 121-127 foreach my $res (@$results) { Link Here
121
    MARC::File::XML->default_record_format(C4::Context->preference('marcflavour'));
121
    MARC::File::XML->default_record_format(C4::Context->preference('marcflavour'));
122
    my $record;
122
    my $record;
123
    eval {
123
    eval {
124
        $record = MARC::Record::new_from_xml($marcxml, "utf8", C4::Context->preference('marcflavour'));
124
        $record = MARC::Record::new_from_xml($marcxml, "UTF-8", C4::Context->preference('marcflavour'));
125
    };
125
    };
126
    if($@) {
126
    if($@) {
127
        warn "(biblio $biblionumber) Error while creating record from marcxml: $@";
127
        warn "(biblio $biblionumber) Error while creating record from marcxml: $@";
(-)a/opac/opac-readingrecord.pl (-1 / +1 lines)
Lines 97-103 foreach my $issue ( @{$issues} ) { Link Here
97
    if ( $marcxml ) {
97
    if ( $marcxml ) {
98
        $marcxml = StripNonXmlChars( $marcxml );
98
        $marcxml = StripNonXmlChars( $marcxml );
99
        my $marc_rec =
99
        my $marc_rec =
100
          MARC::Record::new_from_xml( $marcxml, 'utf8',
100
          MARC::Record::new_from_xml( $marcxml, 'UTF-8',
101
            C4::Context->preference('marcflavour') );
101
            C4::Context->preference('marcflavour') );
102
        $issue->{normalized_upc} = GetNormalizedUPC( $marc_rec, C4::Context->preference('marcflavour') );
102
        $issue->{normalized_upc} = GetNormalizedUPC( $marc_rec, C4::Context->preference('marcflavour') );
103
    }
103
    }
(-)a/svc/bib (-1 / +1 lines)
Lines 90-96 sub update_bib { Link Here
90
    my $inxml = $query->param('POSTDATA');
90
    my $inxml = $query->param('POSTDATA');
91
    print $query->header(-type => 'text/xml', -charset => 'utf-8');
91
    print $query->header(-type => 'text/xml', -charset => 'utf-8');
92
92
93
    my $record = eval {MARC::Record::new_from_xml( $inxml, "utf8", C4::Context->preference('marcflavour'))};
93
    my $record = eval {MARC::Record::new_from_xml( $inxml, "UTF-8", C4::Context->preference('marcflavour'))};
94
    my $do_not_escape = 0;
94
    my $do_not_escape = 0;
95
    if ($@) {
95
    if ($@) {
96
        $result->{'status'} = "failed";
96
        $result->{'status'} = "failed";
(-)a/svc/import_bib (-1 / +1 lines)
Lines 73-79 sub import_bib { Link Here
73
    }
73
    }
74
74
75
    my $marcflavour = C4::Context->preference('marcflavour') || 'MARC21';
75
    my $marcflavour = C4::Context->preference('marcflavour') || 'MARC21';
76
    my $marc_record = eval {MARC::Record::new_from_xml( $inxml, "utf8", $marcflavour)};
76
    my $marc_record = eval {MARC::Record::new_from_xml( $inxml, "UTF-8", $marcflavour)};
77
    if ($@) {
77
    if ($@) {
78
        $result->{'status'} = "failed";
78
        $result->{'status'} = "failed";
79
        $result->{'error'} = $@;
79
        $result->{'error'} = $@;
(-)a/svc/new_bib (-1 / +1 lines)
Lines 54-60 sub add_bib { Link Here
54
    print $query->header(-type => 'text/xml', -charset => 'utf-8');
54
    print $query->header(-type => 'text/xml', -charset => 'utf-8');
55
55
56
    my $marcflavour = C4::Context->preference('marcflavour') || 'MARC21';
56
    my $marcflavour = C4::Context->preference('marcflavour') || 'MARC21';
57
    my $record = eval {MARC::Record::new_from_xml( $inxml, "utf8", $marcflavour)};
57
    my $record = eval {MARC::Record::new_from_xml( $inxml, "UTF-8", $marcflavour)};
58
    my $do_not_escape = 0;
58
    my $do_not_escape = 0;
59
    if ($@) {
59
    if ($@) {
60
        $result->{'status'} = "failed";
60
        $result->{'status'} = "failed";
(-)a/t/db_dependent/Koha/Z3950Responder/GenericSession.t (-4 / +4 lines)
Lines 109-119 subtest 'test_search' => sub { Link Here
109
109
110
    is($rs->size(), 2, 'Two results returned');
110
    is($rs->size(), 2, 'Two results returned');
111
111
112
    my $returned1 = MARC::Record->new_from_xml($rs->record(0)->raw());
112
    my $returned1 = MARC::Record->new_from_xml($rs->record(0)->raw(), 'UTF-8');
113
    ok($returned1, 'Record 1 returned as MARCXML');
113
    ok($returned1, 'Record 1 returned as MARCXML');
114
    is($returned1->as_xml, $marc_record_1->as_xml, 'Record 1 returned properly');
114
    is($returned1->as_xml, $marc_record_1->as_xml, 'Record 1 returned properly');
115
115
116
    my $returned2= MARC::Record->new_from_xml($rs->record(1)->raw());
116
    my $returned2= MARC::Record->new_from_xml($rs->record(1)->raw(), 'UTF-8');
117
    ok($returned2, 'Record 2 returned as MARCXML');
117
    ok($returned2, 'Record 2 returned as MARCXML');
118
    is($returned2->as_xml, $marc_record_2->as_xml, 'Record 2 returned properly');
118
    is($returned2->as_xml, $marc_record_2->as_xml, 'Record 2 returned properly');
119
119
Lines 140-150 subtest 'test_search' => sub { Link Here
140
    my @records = $nodes[0]->getElementsByTagNameNS($marc_ns, 'record');
140
    my @records = $nodes[0]->getElementsByTagNameNS($marc_ns, 'record');
141
    is(scalar(@records), 2, 'Two results returned');
141
    is(scalar(@records), 2, 'Two results returned');
142
142
143
    $returned1 = MARC::Record->new_from_xml($records[0]->toString());
143
    $returned1 = MARC::Record->new_from_xml($records[0]->toString(), 'UTF-8');
144
    ok($returned1, 'Record 1 returned as MARCXML');
144
    ok($returned1, 'Record 1 returned as MARCXML');
145
    is($returned1->as_xml, $marc_record_1->as_xml, 'Record 1 returned properly');
145
    is($returned1->as_xml, $marc_record_1->as_xml, 'Record 1 returned properly');
146
146
147
    $returned2= MARC::Record->new_from_xml($records[1]->toString());
147
    $returned2= MARC::Record->new_from_xml($records[1]->toString(), 'UTF-8');
148
    ok($returned2, 'Record 2 returned as MARCXML');
148
    ok($returned2, 'Record 2 returned as MARCXML');
149
    is($returned2->as_xml, $marc_record_2->as_xml, 'Record 2 returned properly');
149
    is($returned2->as_xml, $marc_record_2->as_xml, 'Record 2 returned properly');
150
150
(-)a/t/db_dependent/Koha/Z3950Responder/ZebraSession.t (-3 / +2 lines)
Lines 106-116 subtest 'test_search' => sub { Link Here
106
106
107
    is($rs->size(), 2, 'Two results returned');
107
    is($rs->size(), 2, 'Two results returned');
108
108
109
    my $returned1 = MARC::Record->new_from_xml($rs->record(0)->raw());
109
    my $returned1 = MARC::Record->new_from_xml($rs->record(0)->raw(), 'UTF-8');
110
    ok ($returned1, 'Record 1 returned as MARCXML');
110
    ok ($returned1, 'Record 1 returned as MARCXML');
111
    is($returned1->as_xml, $marc_record_1->as_xml, 'Record 1 returned properly');
111
    is($returned1->as_xml, $marc_record_1->as_xml, 'Record 1 returned properly');
112
112
113
    my $returned2= MARC::Record->new_from_xml($rs->record(1)->raw());
113
    my $returned2= MARC::Record->new_from_xml($rs->record(1)->raw(), 'UTF-8');
114
    ok ($returned2, 'Record 2 returned as MARCXML');
114
    ok ($returned2, 'Record 2 returned as MARCXML');
115
    is($returned2->as_xml, $marc_record_2->as_xml, 'Record 2 returned properly');
115
    is($returned2->as_xml, $marc_record_2->as_xml, 'Record 2 returned properly');
116
116
117
- 

Return to bug 24827