To fix this, you can specify the correct codec when opening the file or when calling the decode method. Make sure you arent mixing up calls to the str.encode () and code () method. If you have a mix of unicode and bytestring values, decode just the bytestrings or encode just the unicode values try to avoid mixing the types. 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 = om_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 ta = (page.original) File "/usr/local/lib/python2.7/site-packages/wok/renderers.py", line 46, in render return markdown(plain, ugins) 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). Traceback (most recent call last): File , line 2, in UnicodeDecodeError: ascii codec cant decode byte 0x95 in position. Hi everyone im trying to add constraints of unicity i can show the message in the beginning but after 2 tests i show this message: UnicodeDecodeError. The 'UnicodeDecodeError: 'ascii' codec can't decode byte' error occurs when trying to decode non-ASCII bytes using the ASCII codec. The solution is to not encode data that is already encoded, or first decode using a suitable codec before trying to encode again, if the data was encoded to a different codec than what you needed.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |