Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

pygments doesn't like utf-8 #10

wbzyl opened this Issue Apr 3, 2010 · 2 comments


None yet
3 participants

wbzyl commented Apr 3, 2010

Whenever pygments see utf-8 chars in strings, for example "hello ąćęłńóśźż" I see:

*** Error while highlighting:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 91: 
   ordinal not in range(128)
(file "/usr/lib/python2.6/site-packages/Pygments-1.3.1-py2.6.egg/pygments/lexer.py", 
   line 148, in get_tokens)

I would like, if possible, to use another codec.


hng commented Jul 7, 2010

If you add "-O encoding=utf8" to the call of pygmentize at line 191 in lib/rocco.rb it shouldn't give you that error anymore. Although I got red rectangles around all non-ascii chars in my generated html file.


mikewest commented Oct 20, 2010

Added -O encoding=utf-8 to the pygmentize call in 1b211bc This appears to resolve the issue for utf-8 and iso-8859-1 input. It'd be nice to deal with other more esoteric encodings, but this looks good enough for the moment.

@hellojustin hellojustin added a commit to hellojustin/rocco that referenced this issue Oct 15, 2016

@hellojustin hellojustin Fixes #10 : ios-8859-1 encoding. Also fixes failing default-styleshee…
…t test.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment