Python File Write Ascii Codec Can Encode Character 8,5/10 2451 reviews

I have made a script that, reads from file a string, and changes each character on ascii table, with a number. Then I add this number, with another number that the user inputs. Texet web camera wcm 183 driver for mac. In the end, the script, writes a txt file with the changed characters.Problem is, if the number is for an ascii character that doesn’t have a character like the above, it gives the above error. Is there a way that, the script will always return a character?

Only encode the Unicode objects when you're done with them. Encode last also means, don't let Python encode your Unicode objects for you. Python will use ASCII and your programs will crash. When in doubt, encode as UTF-8 means this: Since UTF-8 can handle any Unicode character, your best bet is to use it as opposed to window-1252 or god forbid. 'UnicodeEncodeError: 'ascii' codec can't encode character' in OutcomeException with Python 2 #1178 blueyed opened this issue Nov 11, 2015 3 comments Assignees.

This may not be a solution, but the link might be relevant, although it mainly focuses on writing a file rather than reading.https://python-forum.io/Thread-Writing-chr-128-to-text-file-returns-errorsHth,

Happy to hear that! will you please share the code here, save a copy in your profile, put the code URL here, so those who face similar issues later can use what you have solved : )Thanks!

ty! This might help! i ll try to implement the solutions and see if there is a different result

Just an update, it works flawlessly!

I will :)