Commit graph

25 commits

Author SHA1 Message Date
Magnus Enger
edf8ad5d5d Bug 3644 Add support for NORMARC
- XSLT for the OPAC
- Value_builders for lesder, 007 and 008
- Default NORMARC framework
- Reverse MARC logic of some subs, so MARC21 is default (and works for NORMARC)
- Add NORMARC as an option to the syspref marcflavour
- Add record.abs for NORMARC
- Add NORMARC and nb as options to Makefile.PL
- Add etc/zebradb/lang_defs/nb/sort-string-utf.chr
- Copy MARC21slim2OAIDC.xsl to NORMARCslim2OAIDC.xsl

Some things are still missing, e.g.:

- XSLT for Intranet
- More MARC21slim2*.xsl transformations
2011-03-30 10:13:37 +02:00
Paul Poulain
4117b293f6 NormalizeString POD Fixing and variable renaming
POD was mistakenly telling that NFD was supposed to be the default
    encoding.  In fact, it is not, it is NFC.
    So the variable $nfc to change to the not default encoding was misleading.
    Renaming it into $nfd

(written by hdl)

Refactored by Chris Cormack

Signed-off-by: Davi <davi@gnu.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-02-18 10:39:56 +13:00
7c0e441d50 replace references to defunct info email address
Now links to Koha project website.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-06-25 05:18:44 -04:00
Andrew Elwell
aa9b4d92cd POD Cleanups
Signed-off-by: Andrew Elwell <Andrew.Elwell@gmail.com>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-06-09 08:38:59 -04:00
Nahuel ANGELINETTI
b41e6e0f73 (MT #2962) add converted chars from ISO5426
This add 0xBE and 0xBD conversion to char table.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-03-16 21:30:43 -04:00
Nahuel ANGELINETTI
4b5483c61e (MT #3075) fix oe char from iso5426
this add oe conversion in chartable for iso5426.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-03-16 21:30:42 -04:00
Lars Wirzenius
7279f55b60 Fix FSF address in directory C4/
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-03-16 20:17:56 -04:00
afed49ccc8 fix POD errors reported by xt/author/podcorrectness.t
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-02-03 15:57:31 -05:00
Paul Poulain
9d1e7f43e1 (bug #4020) XSLT unimarc display
When using XSLT Display, and UNIMARC,
since marcFlavour is not used in encoding data, when data is true utf8, as_xml
fails on some subfields.

Moreover, because transformMARCXMLForXSLT edits some values in the marc record
and the PERL UTF8 is not handled by MARC::File::USMARC, it endsup in double
encoding the data.
Sending a patch to fix both issues.

This patch adds
    - two functions in  C4/Charset.pm
        NormalizeString (uses Unicode::Normalize)
        SetUTF8Flag (This function in my opinion belongs to MARC::Record, or at least MARC::File::USMARC)
    - edits C4::XSLT in order to cope with the correct marcflavour
    - edits C4::Search searchResults to use setUTF8Flag
2010-01-28 15:11:51 +01:00
Henri-Damien LAURENT
d83ca6fedf Adding a test in C4::Charset in UNIMARC_Encoding 2009-11-17 16:27:13 +01:00
Henri-Damien LAURENT
9d52c46dda Better conformance for UNIMARC Authorities Encoding
encoding is on 8th character and not 9th
2009-11-17 16:27:12 +01:00
Henri-Damien LAURENT
7177a6528a Bug Fixing : C4::Charset source_encoding always set to iso-8859-1 2009-10-14 18:19:09 +02:00
Henri-Damien LAURENT
7eca37db4f Authorities bulkmarcimport
Adding some new options to bulkmarcimport :
-k idtagsubfield in order to store the id of the file record into another field
-match tagsubfield,index
-a to import authorities
-l logfilename to store logs

Bug Fixing : C4/Charset.pm
Charset was incorrect for UNIMARC Authorities

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-09-30 11:22:21 +02:00
J. David Bavousett
88ba183305 Handle null-or-empty to Charset::StripNonXmlChars
When rebuild_zebra.pl is run from cron, there is an occasional error
of the form:

Use of uninitialized value $str in substitution (s///) at /home/ebpl/kohaclone/C4/Charset.pm line 304.

This error is occuring when the string that is fed to Charset::StripNonXmlChars
is null or undefined, for some reason.

This fix will handle the null-or-empty condition, and thus suppress the error.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-09-12 08:42:11 -04:00
Galen Charlton
a244ff6671 bug 2505: turn on warnings in seven modules
C4::XSLT
C4::VirtualShelves
C4::Review
C4::Output
C4::Boolean
C4::Charset
C4::Stats

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-06-07 20:09:16 -05:00
Galen Charlton
da51de184c bug 2926: fix staging import hang
Fixes a hang of the staging import tool when it
attempts to process a MARC21 record that claims
that it's UTF-8 when it is not.  The staging import
will now attempt to fix the character encoding of such
records.

Also added a FIXME to bulkmarcimport.pl, which because
of its use of MARC::Batch will skip over such records -
better than the original hang of the staging import, but
worse than the staging import's new ability to fix such
records.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-06-07 13:17:06 -05:00
Nahuel ANGELINETTI
1a4e67c143 (bug #3183) fix the SetMarcUnicodeFlag function
This patch fix the funciton SetMarcUnicodeFlag for UNIMARC support, now the function will fix the length of the field, and set encoding as "50  " instead of "5050".

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-05-08 08:23:14 -05:00
Joe Atzberger
248e0392e2 Multi-bug fix - SetMarcUnicodeFlag for records coming from Koha
This has bearing on bugs 2905, 2665, 2514 and other "wide character" crashes
related to diacritics and Unicode.  This should help open the door for reliable
input of diacriticals via acquisitions.

MARC21_utf8_flag_fix.pl diagnoses and fixes existing problems with MARC data
affected by the bug.

Adding SetMarcUnicodeFlag to TransformKohaToMarc prevents the bug from corrupting
further data.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-18 09:14:43 -05:00
0551f48150 Improve C4::Charset::MarcToUTF8Record performance
A script like bulkmarkimport.pl spends most of the time
in C4::Charset::MarcToUTF8Record function, and
specifically in C4::Charset::char_decode5426
just initializing a hash. This patch moves this
hash outside function to avoid its initializing
each time the functon is called.

A test on a specific conversion script shows me
that performances were improved from 23s to 8s.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-11-06 15:53:29 -06:00
Galen Charlton
cfea172544 work around issue in MARC::Charset
Because of a bug in MARC::Charset 0.98, if a string to convert from
MARC-8 to UTF-8 has (a) one or more diacritics that (b) are only in character positions
128 to 255 inclusive, the resulting converted string is not in
UTF-8, but the legacy 8-bit encoding (e.g., ISO-8859-1).  As a result,
when such a record is converted to XML using ->as_xml_record(), the resulting
XML can be truncated at the offending character.  An example of such a record
is one that has a price in Briish pounds in the 260$c but no other diacritics.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-01 06:46:04 -05:00
Galen Charlton
b549d7e1f1 added StripNonXmlChars to C4::Charset
Added invocations of StripNonXmlChars to uses
of new_from_xml() that involve records
saved to Koha fields via MARC::Record->as_xml();
for batch jobs that work on MARC XML files
coming from external sources, StripNonXmlChars
should not necessarily be used, as it may
be better to reject a file or record if it
contains that kind of encoding error.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-02-08 20:22:42 -06:00
Galen Charlton
c86f5df431 charset: fixed bug that prevented ISO-5426 conversion
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-02-03 07:24:45 -06:00
Galen Charlton
60a98d258a IMPORTANT - refactor MARC character set handling
* IsStringUTF8ish - determine if scalar contains a string in UTF8
* MarcToUTF8Record - convert MARC blob or MARC::Record to UTF8
* SetMarcUnicodeFlag - set appropriate MARC21 or UNIMARC field to
  indicate that record is in UTF-8.

Design points of this module include:

* No dependencies on other C4 modules, making it easier to add
  more test cases
* All character conversion code in one place
* Single entry point for doing a character conversion on a
  MARC record
* Capture of errors and warnings produced by Text::Iconv
  and MARC::Charset
* Start of support for guessing the source character set of
  a MARC record.

Several functions were moved from other scripts
or modules to C4::Charset:

* C4::Koha->FixEncoding (expanded and renamed
  MarcToUTF8Record)
* C4::Koha->char_decode5426
* fMARC8ToUTF8 from bulkmarcimport.pl (renamed
  _marc_marc8_to_utf8)

Several batch jobs were adjusted to use MarcToUTF8Record instead of
FixEncoding.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-02-03 07:23:56 -06:00
acli
e9858a2910 Moved C4/Charset.pm to C4/Interface/CGI/Output.pm 2003-02-02 07:19:29 +00:00
acli
ea50c2acb6 Preliminary fix of the CGI.pm problem of always assuming that everything is
in ISO-8859-1.

A new C4::Charset module (tentative name) has been created to guess the
charset of a piece of HTML markup. The CGI programs will be modified to use
this module as they are encountered during translation.
2003-01-19 06:15:44 +00:00