It sounds like you might be dealing with an encoding issue. Try specifying the encoding explicitly when opening the file:
with open("yourfile.txt", "r", encoding="utf-8") as file: content = file.read()If that doesn't work, check the file's encoding using a tool like
chardet
to determine the correct encoding.User has been warned for this post. Reason: Just posting random answer
buran write Mar-12-2025, 06:59 AM:
How does your post answer OP question? It's not even remotely related. Not to mention OP question is a year old
How does your post answer OP question? It's not even remotely related. Not to mention OP question is a year old