fix UnicodeEncodeError in ultisnips_completer

Fix a rare exception when a description of UltiSnips snippet contains
unicode symbols.

Fixes #274
This commit is contained in:
Stanislav Golovanov 2013-04-26 00:42:02 +04:00
parent a9215f10fe
commit 4d138b2b7f

View File

@ -62,7 +62,7 @@ def _GetCandidates():
# class.trigger - name of snippet trigger word ( e.g. defn or testcase )
# class.description - description of the snippet
return [ { 'word': str( snip.trigger ),
'menu': str( '<snip> ' + snip.description ) }
'menu': str( '<snip> ' + snip.description.encode('utf-8') ) }
for snip in rawsnips ]
except:
return []