syntax-highlighting: always use utf-8 to avoid ascii codec issues
Dieser Commit ist enthalten in:
Ursprung
33bc949a1e
Commit
d3756bd7b0
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
import io
|
||||||
from pygments import highlight
|
from pygments import highlight
|
||||||
from pygments.util import ClassNotFound
|
from pygments.util import ClassNotFound
|
||||||
from pygments.lexers import TextLexer
|
from pygments.lexers import TextLexer
|
||||||
@ -29,6 +30,8 @@ from pygments.lexers import guess_lexer_for_filename
|
|||||||
from pygments.formatters import HtmlFormatter
|
from pygments.formatters import HtmlFormatter
|
||||||
|
|
||||||
|
|
||||||
|
sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8')
|
||||||
|
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
|
||||||
data = sys.stdin.read()
|
data = sys.stdin.read()
|
||||||
filename = sys.argv[1]
|
filename = sys.argv[1]
|
||||||
formatter = HtmlFormatter(style='pastie')
|
formatter = HtmlFormatter(style='pastie')
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren