UnicodeEncodeError: ascii when wishing to use unicode?

Str() returns a string yes. And a str will be encoded when written, yes. I'm not entirely sure why the ascii encoding is being used (it is the default encoding in Python 2, but not in Python 3), but I'm even less sure why you do str(sentence) If you want to decode bytes you don' use str() you use decode() So start with removing the str() call.

Str() returns a string yes. And a str will be encoded when written, yes. I'm not entirely sure why the ascii encoding is being used (it is the default encoding in Python 2, but not in Python 3), but I'm even less sure why you do str(sentence).

If you want to decode bytes you don' use str() you use .decode(). So start with removing the str() call. You don't give a full traceback, but I'm guessing that it's the str(sentence) that gives the error.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions