Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

pygments doesn't like utf-8 #10

Closed
wbzyl opened this issue Apr 3, 2010 · 2 comments
Closed

pygments doesn't like utf-8 #10

wbzyl opened this issue Apr 3, 2010 · 2 comments

Comments

@wbzyl
Copy link

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.

--Włodek

@hng
Copy link

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
Copy link
Collaborator

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 added a commit to hellojustin/rocco that referenced this issue Oct 15, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants