开发者

Encoding Japanese characters

How would I encode the following:

chapter_mapping = {'chapter': ' チャプター'}

so I can call chapter_mapping['chap开发者_开发知识库ter']. Thank you.


You'll also need to add a header to your file in python 2:

# -*- coding: utf-8 -*-
chapter_mapping = {'chapter': u'チャプター'}


Always use unicode literals.

chapter_mapping = {'chapter': u' チャプター'}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜