4

How can store latin characters in appengine? (e.g. "peña") when I want to store this I get this error:

UnicodeDecodeError: 'ascii' codec can't decode byte 0xf1 in position 2: ordinal not in range(128)

I can change the Ñ by N, but, there not another and better way?

And if i encode the value, how can print "Peña" again?

2 Answers 2

2

GAE stores strings in unicode. Perhaps encode your string in unicode before saving it.

value = "peña"

value.encode("utf8")
0
0

From the error ("Unicode Decode Error"), it seems you could have more luck using Unicode - I'd try UTF-8.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.