如何修复:“UnicodeDecodeError:‘ASCII’编解码器不能解码字节”as3:~/ngokevin-site# nano content/blog/20140114_test-chinese.mkdas3:~/ngokevin-site# wokTraceback (most recent call last):
File "/usr/local/bin/wok", line 4, inEngine()File "/usr/local/lib/python2.7/site-packages/wok/engine.py", line 104, in init
self.load_pages()File "/usr/local/lib/python2.7/site-packages/wok/engine.py", line 238, in load_pages
p = Page.from_file(os.path.join(root, f), self.options, self, renderer)File "/usr/local/lib/python2.7/site-packages/wok/page.py",
line 111, in from_file
page.meta['content'] = page.renderer.render(page.original)File "/usr/local/lib/python2.7/site-packages/wok/renderers.py", line 46,
in renderreturn markdown(plain, Markdown.plugins)File "/usr/local/lib/python2.7/site-packages/markdown/init.py", line 419, in markdown
return md.convert(text)File "/usr/local/lib/python2.7/site-packages/markdown/init.py", line 281, in convert
source = unicode(source)UnicodeDecodeError: 'ascii' codec can't decode byte 0xe8 in position 1: ordinal not in range(128). --
Note: Markdown only accepts unicode input!怎么修?在其他一些基于python的静态博客应用程序中,可以成功地发布中文帖子。比如这个应用程序:http://github.com/vrypan/bucket3..在我的网站上http://bc3.brite.biz/,中文文章可以成功出版。
3 回答
一只甜甜圈
TA贡献1836条经验 获得超5个赞
source = unicode(source, 'utf-8')
添加回答
举报
0/150
提交
取消