Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Question

added 14 characters in body
Source Link
Tomerikoo
  • 19.6k
  • 16
  • 57
  • 68

I ́mI'm trying to parse a csv downloaded file from my bank account. The file gets opened with: with open('umsatz.csv', 'r', encoding="utf-8") as csv_file:

with open('umsatz.csv', 'r', encoding="utf-8") as csv_file:

When trying to simplesimply print the various entries I got the following error:

File "C:\Users\joajo\AppData\Local\Programs\Python\Python39\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\ufffd' in position 13: character maps to

 File "C:\Users\joajo\AppData\Local\Programs\Python\Python39\lib\encodings\cp1252.py", line 19, in encode
 return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\ufffd' in position 13: character maps to <undefined>

Opening in notepad++ the problematic texts looks like: LOHN-/GEHALTS�BERTRAGFREMDSPESE

LOHN-/GEHALTS�BERTRAGFREMDSPESE

I ́m trying to parse a csv downloaded file from my bank account. The file gets opened with: with open('umsatz.csv', 'r', encoding="utf-8") as csv_file:

When trying to simple print the various entries I got the following error:

File "C:\Users\joajo\AppData\Local\Programs\Python\Python39\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\ufffd' in position 13: character maps to

Opening in notepad++ the problematic texts looks like: LOHN-/GEHALTS�BERTRAGFREMDSPESE

I'm trying to parse a csv downloaded file from my bank account. The file gets opened with:

with open('umsatz.csv', 'r', encoding="utf-8") as csv_file:

When trying to simply print the various entries I got the following error:

 File "C:\Users\joajo\AppData\Local\Programs\Python\Python39\lib\encodings\cp1252.py", line 19, in encode
 return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\ufffd' in position 13: character maps to <undefined>

Opening in notepad++ the problematic texts looks like:

LOHN-/GEHALTS�BERTRAGFREMDSPESE
Source Link

how to resolve encoding errors in python?

I ́m trying to parse a csv downloaded file from my bank account. The file gets opened with: with open('umsatz.csv', 'r', encoding="utf-8") as csv_file:

When trying to simple print the various entries I got the following error:

File "C:\Users\joajo\AppData\Local\Programs\Python\Python39\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\ufffd' in position 13: character maps to

Opening in notepad++ the problematic texts looks like: LOHN-/GEHALTS�BERTRAGFREMDSPESE

lang-py

AltStyle によって変換されたページ (->オリジナル) /