Re: Q.: MARC8 vs. MARC/Unicode and pymarc and misencoded III records

From: Brian Kennison <KennisonB_at_nyob>
Date: Fri, 9 Mar 2012 09:16:38 -0500
To: CODE4LIB_at_LISTSERV.ND.EDU
On Mar 8, 2012, at 1:46 PM, Terray, James wrote:

> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe8 in position 9: ordinal not in range(128)


Hello everyone,

I just ran into this the other day when trying to write to a file. I searched the documentation and found this:

fp = codecs.open("dc.csv", mode="w", encoding="utf-8") 

This opens a file that is utf-8 aware and it let me write the file. Doesn't answer your question about the encoding but it will let you save the record. 

--
Brian Kennison
Western Connecticut State University
Received on Fri Mar 09 2012 - 09:17:24 EST