2
GAE에 내장 된 간단한 UI 번역 (파이썬 SDK 사용)을 만들고 싶습니다.파이썬으로 프로그래밍 방식으로 GAE 데이터 스토어에 utf-8 문자 (중국어, 아랍어, 일본어 .. 등) 레코드를 삽입하십시오.
def add_translation(self, pid=None):
trans = Translation()
trans.tlang = db.Key("agtwaW1kZXNpZ25lcnITCxILQXBwTGFuZ3VhZ2UY8aIEDA")
trans.ttype = "UI"
trans.transid = "ui-about"
trans.content = "关于我们"
trans.put()
이 생성되어 부호화 에러 :
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 0: ordinal not in range(128)
방법 유니 코드 (UTF-8) 문자를 올바른 삽입 콘텐츠를 인코딩하기?
감사합니다 아담, 그냥 작동합니다 ...-) –