Module MARC::Record doesn't set well lenght in leader.
Hi to all, [sorry the previous mail is incomplete] I have a problem with creating marc21 records with module MARC::Record I create marc records from reading a text file, but the module doesn't set a correct lenght in the leader. So same subfields are cutted and I loose data inside subfiels and inside indicator. An example of problematic record: DB<10> x $record 0 MARC::Record=HASH(0x53904f8) '_fields' => ARRAY(0x5471fa8) 0 MARC::Field=HASH(0x54694b8) '_data' => 328 '_is_control_field' => 1 '_tag' => 001 '_warnings' => ARRAY(0x53bb8d8) empty array 1 MARC::Field=HASH(0x545ea10) '_data' => 'IT-RoAPU' '_is_control_field' => 1 '_tag' => 003 '_warnings' => ARRAY(0x545df00) empty array 2 MARC::Field=HASH(0x5460d78) '_data' => 20130929162908.0 '_is_control_field' => 1 '_tag' => 005 '_warnings' => ARRAY(0x592ee28) empty array [...] 15 MARC::Field=HASH(0x546b1a8) '_ind1' => 0 '_ind2' => 0 '_is_control_field' => 0 '_subfields' => ARRAY(0x541c940) 0 'a' 1 'Biblia.' 2 'p' 3 'V.T.' 4 'p' 5 'Qohélet' 6 'x' 7 'Commenti.' 8 9 9 171552 '_tag' => 630 '_warnings' => ARRAY(0x5465538) empty array 16 MARC::Field=HASH(0x5465a18) '_ind1' => ' ' '_ind2' => ' ' '_is_control_field' => 0 '_subfields' => ARRAY(0x5466cd0) 0 'a' 1 'Biblia.' 2 'p' 3 'V.T.' 4 'p' 5 'Qohélet.' 6 'l' 7 'Inglese.' 8 'f' 9 1988. 10 9 11 17155 '_tag' => 240 '_warnings' => ARRAY(0x5477168) empty array 17 MARC::Field=HASH(0x5462fa8) '_ind1' => ' ' '_ind2' => ' ' '_is_control_field' => 0 '_subfields' => ARRAY(0x541eb38) 0 'a' 1 'IT-RoAP' '_tag' => 850 '_warnings' => ARRAY(0x5931948) empty array 18 MARC::Field=HASH(0x5469788) '_ind1' => ' ' '_ind2' => ' ' '_is_control_field' => 0 '_subfields' => ARRAY(0x5472170) 0 'c' 1 32 '_tag' => 999 '_warnings' => ARRAY(0x54693f8) empty array '_leader' => '00859nam a2200265 i 4500' '_warnings' => ARRAY(0x53682b0) 0 'Invalid record length in record 324: Leader says 00859 bytes but it\'s actually 861' 1 'field does not end in end of field character in tag 630 in record 324' 2 'field does not end in end of field character in tag 240 in record 324' 3 "Invalid indicators \"\c^02\" forced to blanks in record 324 for tag 240\cJ" 4 'field does not end in end of field character in tag 850 in record 324' 5 "Invalid indicators \"3\c^ \" forced to blanks in record 324 for tag 850\cJ" 6 'field does not end in end of field character in tag 999 in record 324' 7 "Invalid indicators \"U\c^ \" forced to blanks in record 324 for tag 999\cJ" In fact indicator of tag 240 are wrong (the correct values are '02'); the real value of 240 $9 is '171553', not '17155'. The real value of 850 $a is 'IT-RoAPU', not 'IT-RoAP' The real value of 999 $c is '328', not '32' As I see the problem start for word 'Qohélet' in the tag 240 and 630. I don't know why the leght is wrong and I don't have idea how to fix it. Chees Zeno Tajoli -- Dr. Zeno Tajoli Dipartimento Gestione delle Informazioni e della Conoscenza z.tajoli@cineca.it fax +39 02 2135520 CINECA - Sede operativa di Segrate
At 10:41 PM 9/29/2013 +0200, Zeno Tajoli wrote: [snip]
3 "Invalid indicators \"\c^02\" forced to blanks in record 324 for tag 240\cJ" 4 'field does not end in end of field character in tag 850 in record 324'
[snip]
As I see the problem start for word 'Qohélet' in the tag 240 and 630. I don't know why the leght is wrong and I don't have idea how to fix it.
MARC (specifically LoC) tends to suggest that accented characters like é are in fact two chars ... and we've found this quite painful under some circumstances. You say you're importing from a text file (assuming UTF8). Can you try just putting a plain "e" (or the old fashioned IBM 130, or ANSI 0233) in this biblio to see if it works properly? Koha appears to never have problems with today's UTF char_set based on the older single chars. Best - Paul
Chees Zeno Tajoli
-- Dr. Zeno Tajoli Dipartimento Gestione delle Informazioni e della Conoscenza z.tajoli@cineca.it fax +39 02 2135520 CINECA - Sede operativa di Segrate _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
--- Maritime heritage and history, preservation and conservation, research and education through the written word and the arts. <http://NavalMarineArchive.com> and <http://UltraMarine.ca>
Hi Paul and all, Il 30/09/2013 01:55, Paul ha scritto:
MARC (specifically LoC) tends to suggest that accented characters like é are in fact two chars ... and we've found this quite painful under some circumstances.
You say you're importing from a text file (assuming UTF8). Can you try just putting a plain "e" (or the old fashioned IBM 130, or ANSI 0233) in this biblio to see if it works properly? Koha appears to never have problems with today's UTF char_set based on the older single chars.
I insert a plain 'e' inside the record and all is OK In fact I also modified lenght in leader from 00859 to 00861 and now with 'é' all is OK My text file is UTF-8. It is during the creation of MARC blob that leader lenght is set in a wrong way. But I don't underdstood why. Cheers Zeno Tajoli -- Dr. Zeno Tajoli Dipartimento Gestione delle Informazioni e della Conoscenza z.tajoli@cineca.it fax +39 02 2135520 CINECA - Sede operativa di Segrate
Zeno, in a script I use to build auth records with MARC::Record I set explicitly utf8 for input and output. Are you doing something similar? open my $out, ">", $outfile; binmode($out, ":utf8"); open my $in, "<:utf8", $infile or die("Can't open auth file!"); ... $record->encoding( 'UTF-8' ); ... print $out $record->as_usmarc(); Bernardo -- Bernardo Gonzalez Kriegel bgkriegel@gmail.com On Mon, Sep 30, 2013 at 9:56 AM, Zeno Tajoli <z.tajoli@cineca.it> wrote:
Hi Paul and all,
Il 30/09/2013 01:55, Paul ha scritto:
MARC (specifically LoC) tends to suggest that accented characters like é
are in fact two chars ... and we've found this quite painful under some circumstances.
You say you're importing from a text file (assuming UTF8). Can you try just putting a plain "e" (or the old fashioned IBM 130, or ANSI 0233) in this biblio to see if it works properly? Koha appears to never have problems with today's UTF char_set based on the older single chars.
I insert a plain 'e' inside the record and all is OK In fact I also modified lenght in leader from 00859 to 00861 and now with 'é' all is OK
My text file is UTF-8. It is during the creation of MARC blob that leader lenght is set in a wrong way.
But I don't underdstood why.
Cheers
Zeno Tajoli -- Dr. Zeno Tajoli Dipartimento Gestione delle Informazioni e della Conoscenza z.tajoli@cineca.it fax +39 02 2135520 CINECA - Sede operativa di Segrate ______________________________**_________________ Koha-devel mailing list Koha-devel@lists.koha-**community.org<Koha-devel@lists.koha-community.org> http://lists.koha-community.**org/cgi-bin/mailman/listinfo/**koha-devel<http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel> website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.**org/ <http://bugs.koha-community.org/>
Hi, Il 30/09/2013 16:08, Bernardo Gonzalez Kriegel ha scritto:
Zeno, in a script I use to build auth records with MARC::Record I set explicitly utf8 for input and output.
Are you doing something similar?
open my $out, ">", $outfile; binmode($out, ":utf8");
open my $in, "<:utf8", $infile or die("Can't open auth file!"); ... $record->encoding( 'UTF-8' ); ... print $out $record->as_usmarc();
I did something like this, but now I rechek the script with more attention on the UTF-8 topic. I wonder to be in mix situation: -- same records with correct UTF-8 -- same records with uncorrect UTF-8. Cheers Zeno Tajoli
On Mon, Sep 30, 2013 at 11:08:13AM -0300, Bernardo Gonzalez Kriegel wrote:
open my $in, "<:utf8", $infile or die("Can't open auth file!");
open my $in, "<:encoding(UTF-8)" is stricter. If this is a problem its probably the input filehandle that's at fault. Colin -- Colin Campbell Chief Software Engineer, PTFS Europe Limited Content Management and Library Solutions +44 (0) 800 756 6803 (phone) +44 (0) 7759 633626 (mobile) colin.campbell@ptfs-europe.com skype: colin_campbell2 http://www.ptfs-europe.com
participants (4)
-
Bernardo Gonzalez Kriegel -
Colin Campbell -
Paul -
Zeno Tajoli