From 4d138b2b7f6ca14e8447d5e44be6a64667bd06c0 Mon Sep 17 00:00:00 2001 From: Stanislav Golovanov Date: Fri, 26 Apr 2013 00:42:02 +0400 Subject: [PATCH] fix UnicodeEncodeError in ultisnips_completer Fix a rare exception when a description of UltiSnips snippet contains unicode symbols. Fixes #274 --- python/completers/general/ultisnips_completer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/completers/general/ultisnips_completer.py b/python/completers/general/ultisnips_completer.py index f63e4fba..94afb406 100644 --- a/python/completers/general/ultisnips_completer.py +++ b/python/completers/general/ultisnips_completer.py @@ -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.description ) } + 'menu': str( ' ' + snip.description.encode('utf-8') ) } for snip in rawsnips ] except: return []