2016-06-27 12 views
1
str="First of all this isn’t one persons opinion, I promise you this is the worst movie ever. I feel like the other people saw a completely different movie. It starts off with a scene that would terrify any child 9 or under and only goes downhill from there. It’s about this kid named Norman that can talk to ghost or something. His weird and very unfunny uncle can also see ghost and warns him about some witches curse and zombies that are coming. I left after the zombies appeared because I couldn’t take any more of this awful movie. The movie was awful, but then the preview Frankenweenie came on and that looked awesome. I'm usually not a fan of Tim Burton but this looks really good. Do not see Paranorman!" 

Dies ist meine Eingabe-Zeichenfolge. Python jedoch ändert sie, wenn ich print strPython Fehler Auflösung '

First of all this isn\xe2\x80\x99t one persons opinion, I promise you this is the worst movie ever. I feel like the other people saw a completely different movie. It starts off with a scene that would terrify any child 9 or under and only goes downhill from there. It\xe2\x80\x99s about this kid named Norman that can talk to ghost or something. His weird and very unfunny uncle can also see ghost and warns him about some witches curse and zombies that are coming. I left after the zombies appeared because I couldn\xe2\x80\x99t take any more of this awful movie. The movie was awful, but then the preview Frankenweenie came on and that looked awesome. I'm usually not a fan of Tim Burton but this looks really good. Do not see Paranorman! 

Wie kann ich "\xe2\x80\x99t"- lösen?

enter image description here

+0

Ich lief es, es gibt nichts von dieser Art http://ideone.com/MoAv6v –

+0

Bitte überprüfen Sie das Bild in der Frage – CoDhEr

+0

Sie verwenden wahrscheinlich Python3 und was Sie sehen, ist Unicode. – Lynch

Antwort

2

Gut fand ich den Fehler. Sie codieren Ihre Zeichenfolge str ist utf-8, die dieses Problem geben, überprüfen Sie das folgende Snippet

str="First of all this isn’t one persons opinion, I promise you this is the worst movie ever. I feel like the other people saw a completely different movie. It starts off with a scene that would terrify any child 9 or under and only goes downhill from there. It’s about this kid named Norman that can talk to ghost or something. His weird and very unfunny uncle can also see ghost and warns him about some witches curse and zombies that are coming. I left after the zombies appeared because I couldn’t take any more of this awful movie. The movie was awful, but then the preview Frankenweenie came on and that looked awesome. I'm usually not a fan of Tim Burton but this looks really good. Do not see Paranorman!" 
print (str.encode('utf-8', 'ignore')) 

Nun Ausgang dieses ist

First of all this isn\xe2\x80\x99t one persons opinion, I promise you this is the worst movie ever. I feel like the other people saw a completely different movie. It starts off with a scene that would terrify any child 9 or under and only goes downhill from there. It\xe2\x80\x99s about this kid named Norman that can talk to ghost or something. His weird and very unfunny uncle can also see ghost and warns him about some witches curse and zombies that are coming. I left after the zombies appeared because I couldn\xe2\x80\x99t take any more of this awful movie. The movie was awful, but then the preview Frankenweenie came on and that looked awesome. I'm usually not a fan of Tim Burton but this looks really good. Do not see Paranorman! 

Ändern Sie die Codierung ascii und es sollte als

erwartet funktionieren

Der Ausgang ist wie folgt

Verwandte Themen