views:

47

answers:

2

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?

A: 

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

Piskvor
+1  A: 

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

value = "peña"

value.encode("utf8")
Brian M. Hunt