Pygments raise error on strange symbols

Create issue
Issue #244 resolved
Former user created an issue

For symbols out of ascii range pygments raise UnicodeEncodeError.

For example if for the attached file you use:

{{{ cat strange_symbols | ./pygmentize -l diff -f html -O style=borland,noclasses=true }}}

You will get:

{{{ UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128) (file "/svn/pygments/formatters/", line 545, in format) }}}

I attached a patch that fixes this problem


Reported by guest

Comments (6)

  1. Former user Account Deleted

    I think that at least pygmentize (command line tool) should not throw this kind of exceptions when normally used. If you don't think so, feel free to close this ticket.

  2. Log in to comment