citeproc-py
citeproc-py copied to clipboard
UnicodeEncodeError: 'charmap' codec can't encode character '\u2013' in position 90: character maps to <undefined>
When it performs the Parser by a JSON structure where the type is "article-journal" when iterar:
for item in bibliography.bibliography():
print(item)
Return the error:
Traceback (most recent call last):
File "bibliografia.py", line 62, in <module>
print(item)
File "C:\Anaconda3\lib\encodings\cp437.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2013' in position 90: character maps to <undefined>
This does not look like an issue with citeproc-py, but rather with unicode in a Windows environment. I remember that this can be quite confusing, but I don't know the details depending on the Python version you're running. You can try these resources:
- Python, Unicode, and the Windows console on Stack Overflow
- Python 3.5+: Unicode output for Windows Console
Let me know if you've been able to solve the issue.