diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2013-05-12 01:57:42 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2013-05-12 01:57:42 -0700 |
commit | 2f5016262a0d01a42df7956d2c07623d2f0962d8 (patch) | |
tree | 74c3d1cbaa99c673e531c9c76acb9d9f4b2c73fb | |
parent | 1dbff806919da1ff72699ec84ec003505fa18bfa (diff) |
Attempt again to fix UnicodeDecodeError (issue #658)
-rwxr-xr-x | share/tools/create_manpage_completions.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/share/tools/create_manpage_completions.py b/share/tools/create_manpage_completions.py index d861886a..07475879 100755 --- a/share/tools/create_manpage_completions.py +++ b/share/tools/create_manpage_completions.py @@ -162,11 +162,14 @@ def built_command(options, description): # But don't let it be empty sentences = [x for x in sentences if x.strip()] if not sentences: sentences = [''] + + udot = lossy_unicode('.') + uspace = lossy_unicode(' ') - truncated_description = sentences[0] + '.' + truncated_description = lossy_unicode(sentences[0]) + udot for line in sentences[1:]: if not line: continue - proposed_description = truncated_description + ' ' + line + '.' + proposed_description = lossy_unicode(truncated_description) + uspace + lossy_unicode(line) + udot if len(proposed_description) <= max_description_width: # It fits truncated_description = proposed_description |