Closed liukeyou closed 9 years ago
Is your hadoop.md
file utf-8
? Also, can you run pelican with --debug
and post the full traceback?
The error stack : E:\dev\opensource\myblog\blog>pelican --debug DEBUG: Adding current directory to system path DEBUG: Temporarily adding PLUGIN_PATHS to system path DEBUG: Restoring system path DEBUG: Template list: [u'!simple/archives.html', u'!simple/article.html', u'!sim ple/author.html', u'!simple/authors.html', u'!simple/base.html', u'!simple/categ ories.html', u'!simple/category.html', u'!simple/gosquared.html', u'!simple/inde x.html', u'!simple/page.html', u'!simple/pagination.html', u'!simple/period_arch ives.html', u'!simple/tag.html', u'!simple/tags.html', u'!simple/translations.ht ml', u'archives.html', u'article.html', u'article_list.html', u'author.html', u' authors.html', u'base.html', u'categories.html', u'category.html', u'gosquared.h tml', u'includes/aboutme.html', u'includes/addthis.html', u'includes/article_inf o.html', u'includes/cc-license.html', u'includes/comment_count.html', u'includes /comments.html', u'includes/disqus_script.html', u'includes/footer.html', u'incl udes/ga.html', u'includes/github-js.html', u'includes/github.html', u'includes/l inks.html', u'includes/liquid_tags_nb_header.html', u'includes/pagination.html', u'includes/piwik.html', u'includes/related-posts.html', u'includes/series.html' , u'includes/sidebar.html', u'includes/taglist.html', u'includes/translations.ht ml', u'includes/twitter_cards.html', u'includes/twitter_timeline.html', u'index. html', u'page.html', u'pagination.html', u'period_archives.html', u'tag.html', u 'tags.html', u'translations.html'] DEBUG: Read file pages\about.md -> Page DEBUG: Signal page_generator_preread.send(PagesGenerator) DEBUG: Successfuly imported extension module "markdown.extensions.codehilite". DEBUG: Successfully loaded extension "markdown.extensions.codehilite.CodeHiliteE xtension". DEBUG: Successfuly imported extension module "markdown.extensions.extra". DEBUG: Successfuly imported extension module "markdown.extensions.smart_strong".
DEBUG: Successfully loaded extension "markdown.extensions.smart_strong.SmartEmph asisExtension". DEBUG: Successfuly imported extension module "markdown.extensions.fenced_code". DEBUG: Successfully loaded extension "markdown.extensions.fenced_code.FencedCode Extension". DEBUG: Successfuly imported extension module "markdown.extensions.footnotes". DEBUG: Successfully loaded extension "markdown.extensions.footnotes.FootnoteExtension". DEBUG: Successfuly imported extension module "markdown.extensions.attr_list". DEBUG: Successfully loaded extension "markdown.extensions.attr_list.AttrListExtension". DEBUG: Successfuly imported extension module "markdown.extensions.def_list". DEBUG: Successfully loaded extension "markdown.extensions.def_list.DefListExtens ion". DEBUG: Successfuly imported extension module "markdown.extensions.tables". DEBUG: Successfully loaded extension "markdown.extensions.tables.TableExtension" . DEBUG: Successfuly imported extension module "markdown.extensions.abbr". DEBUG: Successfully loaded extension "markdown.extensions.abbr.AbbrExtension". DEBUG: Successfully loaded extension "markdown.extensions.extra.ExtraExtension".
DEBUG: Successfuly imported extension module "markdown.extensions.meta".
DEBUG: Successfully loaded extension "markdown.extensions.meta.MetaExtension".
DEBUG: Signal page_generator_context.send(PagesGenerator,
The hadoop.md content
Title: hadoop Date: 2014-12-28 11:20 Modified: 2014-12-28 18:30 Authors: Liu Keyou Summary: hadoop lang: 'chs'
test u'中文'
The pelicanconf.py content
LOCALE = ('chs') TIMEZONE = 'Asia/Shanghai' DEFAULT_LANG = 'chs' DATE_FORMAT={'zh':('zh_CN','%Y-%m-%d,%a'),}
I resolve this problem. Because the coding page of error file (hadoop.md) is GBK, pelican assume the coding page is utf-8, so must change the coding page from GBK to utf-8 (can use ultraedit).
When the article include chinese , the pelican show the this error. ERROR: Could not process pages\hadoop.md | 'utf8' codec can't decode byte 0xd6 in position 124: invalid continuation by te
pelican version 3.5 OS : Windows 8.1 Python : 2.7.7 C:\Users\xxxxx>locale LANG= LC_CTYPE="C.UTF-8" LC_NUMERIC="C.UTF-8" LC_TIME="C.UTF-8" LC_COLLATE="C.UTF-8" LC_MONETARY="C.UTF-8" LC_MESSAGES="C.UTF-8" LC_ALL=