RE: Help for utf-8 output - followup on Record Length
[email protected] (Bryan Baldus)
| Newsgroups | perl.perl4lib |
|---|---|
| Message-ID | <1F95E99A11EFA541B0BDE754166A8F7002DF7408@qbiex.qbi.quality-books.com> |
On Monday, March 03, 2008 3:16 PM, Michael Doran wrote:
>I looked through the MARC::Record CHANGES file [3]. Although there are
some enhancements/fixes regarding the use of UTF-8, I don't see anything
that explicitely states that more current versions of MARC::Record now
compute the record length in bytes. It seems like that would be a good
thing.<
I thought this was done starting with MARC::Record v2.0 RC1, based on a
posting from Ed Summers, Fri, 20 May 2005:
<http://www.mail-archive.com/perl4lib%40perl.org/msg00709.html>
Looking at MARC::File::USMARC, an internal sub, _build_tag_directory(),
includes a line "my $len = bytes::length( $str );" and the total record
length appears to be calculated from:
$dataend += $len;
#...
my $baseaddress =
LEADER_LEN + # better be 24
( @directory * DIRECTORY_ENTRY_LEN ) +
# all the directory entries
1; # end-of-field marker
my $total =
$baseaddress + # stuff before first field
$dataend + # Length of the fields
1; # End-of-record marker
I hope this helps,
Bryan Baldus
[email protected]
[email protected]
http://home.inwave.com/eija