fish-shell/fish-shell — pull request #420 by Jean-Daniel (2012-12-02 14:42:14+00:00)
Title: Fix for issue #419: create_manpage_completions.py fails with UnicodeDecodeError

When running create_manpage_completions.py on system where python sys.getdefaultencoding() is ASCII, the script fails for 2 reasons:

- When truncating a description, it try to append a "…" character using a standard string and not an Unicode string.
This character cause an UnicodeDecodeError at
`"/usr/local/share/fish/tools/create_manpage_completions.py:102": output_list.append(' '.join(comps))`

This patch fix this issue by using an unicode string for the truncation_suffix string.

- When trying to write the resulting string in the .fish file, the write() call raise a UnicodeEncodeError, as the ellipsis character is not an ascii supported character. This patch fix this issue by using the codecs package to open a file in utf-8 mode instead of relying on the default python encoding.