- ensure_ascii=Falseを指定することで日本語対応
- 正直、何をやっているのか不明(とりあえず動いた)
というところです。
(参考)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def OJEncoder(obj): | |
class MyEncoder(JSONEncoder): | |
def default(self, o): | |
return o.__dict__ | |
return MyEncoder(ensure_ascii=False).encode(obj) |
0 件のコメント:
コメントを投稿