aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-10-05 13:19:44 +0200
committerAnton Khirnov <anton@khirnov.net>2012-10-05 13:19:44 +0200
commit5ecde5c8d8016ecd56b7123b3f423516e05f8d47 (patch)
tree0b9dd592da5492055f05f3e1235f94e088448742
parent2916df6fcfb253538b487274e70af20cd65f1fbe (diff)
vim plugin: fix displaying attachments with non-ascii namesHEADvim
-rw-r--r--vim/plugin/nm_vim.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/vim/plugin/nm_vim.py b/vim/plugin/nm_vim.py
index 7f67189..156d398 100644
--- a/vim/plugin/nm_vim.py
+++ b/vim/plugin/nm_vim.py
@@ -326,7 +326,9 @@ class ShowThread(NMBuffer):
b = vim.current.buffer
if part.get('Content-Disposition', '').lower().startswith('attachment'):
self.objects[-1].attachments.append(Attachment(len(b), len(b), part))
- b.append(('[ Attachment: %s (%s)]'%(part.get_filename(), part.get_content_type())).split('\n'))
+ s = ('[ Attachment: %s (%s)]'%(part.get_filename(),
+ part.get_content_type())).encode('utf-8')
+ b.append(s.split('\n'))
if part.get_content_maintype() == 'text':
p = self._read_text_payload(part)