summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pastepy.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/pastepy.py b/pastepy.py
index 9ad21de..2485c2c 100644
--- a/pastepy.py
+++ b/pastepy.py
@@ -63,9 +63,9 @@ class Paste(object):
def preview(self, mp):
try:
- lex = get_lexer_by_name(mp['syntax'].value)
+ lex = get_lexer_by_name(mp['syntax'].value.decode('utf8'))
lexername = lex.name
- text = highlight(mp['text'].value, lex, self.formatter)
+ text = highlight(mp['text'].value.decode('utf8'), lex, self.formatter)
except:
return self.message('Could not find the lexer "%s".' % mp['syntax'].value, 'Error')
@@ -75,9 +75,9 @@ class Paste(object):
'header': '%s – Preview' % settings.pastebin_name,
'hash': None,
'date': datetime.datetime.utcnow().ctime(),
- 'nick': mp['nick'].value or 'Anoynmous',
+ 'nick': mp['nick'].value.decode('utf8') or 'Anoynmous',
'syntax': lexername,
- 'pastetitle': mp['title'].value or 'Untitled',
+ 'pastetitle': mp['title'].value.decode('utf8') or 'Untitled',
'text': text,
}))]