Coding error in Python: Readline() when reading UTF-8 file throws: 'charmap' codec can't decode byte
📁 string, Advanced Python Topics, AI
Trying to read the port file from Iana. It is saved in UTF-8 encoding without BOM. But on one of the lines the readline() function throws this error:
'charmap' codec can't decode byte 0x98 in position 7938: character maps to <undefined>
The line in the file looks like this:
# Jim Harlan <"" Jimh & infowest.com">
What workaround can I come up with for this? Or is there a direct solution?
upd
A workaround in the form of removing this line would work (and for some reason it's only one), but only during debugging, because later the partners will tear my hair out. I will also post the code that
No answers yet.
Log in to leave an answer
Blogs
Functional Programming in TypeScript: Advanced Level
Containerizing Swift Applications with Docker: A Complete Developer's Guide
How to Get Hired as a Rust Developer: Tips and Resume in Practice
CLI utilities in Rust: how to write your first tool in an evening