Open zurek11 opened 6 years ago
I believe it defaults to marc8 encoding, try changing your with open line to:
with open('catalogue.dat', to_unicode=True, force_utf8=True, 'rb') as fh:
From the MARCReader class docstring in the marc8.py file:
If you find yourself in the unfortunate position of having data that is utf-8 encoded without the leader set appropriately you can use the force_utf8 parameter:
reader = MARCReader(file('file.dat'), to_unicode=True, force_utf8=True)
Not sure, if that's the particular problem you're having, but that might help. Though, you might need to remove the to_unicode=True portion that I recommended.
Hello. I have simple data collected from YAZ commands.
yaz-client -m catalogue.dat
I am connecting to library which has MARC21 format and UTF-8 encoding. I am saving records to catalogue.dat file. It's CZECH library so titles are with special characters for example Ř or Ě etc. when i will run this code:
Console will print this:
So basicly there are two issues. First why it prints couldn't find errors and why it prints data without that special characters? Thank you so much.