Hi,

you should use the utf8 encoding, when creating a python file.

The marcxml file should have in the first line encoding='UTF-8'

In python you should use encode('utf8')

Regards, Harald

Am 19.07.21 um 16:10 schrieb Javi Legido:
Hi there.

I'm trying to import an authority type 'GEOGR_NAME' with 'ç' in its name
(field '151 a'):

França

So far:

1. If I manually add it from GUI (I want to import it from .marcxml file)
it works typing 'ç' character. If I save the record as MARCXML I get below
encoding:

     <subfield code="a">Fran&#xE7;a</subfield>

2. If I use python to encode it:

         return string.strip().encode("ascii",
"xmlcharrefreplace").decode("ascii")

The generated MARCXML line looks like:

     <subfield code="a">Fran&#231;a</subfield>

In the GUI looks like 'Franȧ', and if I save it as MARCXML looks like:

     <subfield code="a">Fran&#x227;</subfield>

Worth mentioning that the bibliographic bit referencing this authority
looks perfect, and it was created exactly the same as for authority, so the
only problem is with authority.

Does anybody faced similar problem before? In other words I need to
generate programatically a MARCXML file to later on import it to koha
(21.x), and some of the records (authorities) contains 'ç' and are not
being encoded right.
_______________________________________________

Koha mailing list  http://koha-community.org
[email protected]
Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
_______________________________________________

Koha mailing list  http://koha-community.org
[email protected]
Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha

Reply via email to