在 appengine 中使用拉丁字符
如何在appengine中存储拉丁字符? (例如“peña”)当我想存储它时,我收到此错误:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf1 in position 2: ordinal not in range(128)
我可以将 Ñ 更改为 N,但是,没有其他更好的方法吗?
如果我对值进行编码,如何再次打印“Peña”?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
GAE 以 unicode 存储字符串。也许在保存字符串之前将其编码为 unicode。
GAE stores strings in unicode. Perhaps encode your string in unicode before saving it.
从错误(“Unicode解码错误”)来看,使用 Unicode 似乎会更幸运 - 我会尝试 UTF-8。
From the error ("Unicode Decode Error"), it seems you could have more luck using Unicode - I'd try UTF-8.