How to fix: "UnicodeDecodeError: 'ascii' codec can't decode byte"
Question: 
    as3:~/ngokevin-site# nano content/blog/20140114_test-chinese.mkd
    as3:~/ngokevin-site# wok
    Traceback (most recent call last):
    File "/usr/local/bin/wok", line 4, in
    Engine()
    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 render
    return 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!
    

how to fix it?

but in some other python-based static blog apps,chinese post can be published
successfully. such as this app: <http://github.com/vrypan/bucket3> .in my site
<http://bc3.brite.biz/,chinese> post can be published successfully.


Answer: **Finally I got it:**

    
    
    as3:/usr/local/lib/python2.7/site-packages# cat sitecustomize.py
    # encoding=utf8  
    import sys  
    
    reload(sys)  
    sys.setdefaultencoding('utf8')
    

**Let me check:**

    
    
    as3:~/ngokevin-site# python
    Python 2.7.6 (default, Dec  6 2013, 14:49:02)
    [GCC 4.4.5] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sys
    >>> reload(sys)
    <module 'sys' (built-in)>
    >>> sys.getdefaultencoding()
    'utf8'
    >>>
    

The above shows the default encoding of python is `utf8`. Then the error is no
more.

