The execution of a simple script is not going as thought.
notAllowed = {"â":"a", "à":"a", "é":"e", "è":"e", "ê":"e",
"î":"i", "ô":"o", "ç":"c", "û":"u"}
word = "dôzerté"
print word
for char in word:
if char in notAllowed.keys():
print "hooray"
word = word.replace(char, notAllowed[char])
print word
print "finished"
The output return the word unchanged, even though it should have changed “ô” and “é” to o and e, thus returning dozerte…
Any ideas?
How about:
Basically, if you want to assign an unicode string to some variable you need to use:
to denote the fact that this is the unicode string.