Fix encoding error when printing to redirected output

When redirecting output to a file sys.stdout.encoding is None, so use
sys.getdefaultencoding() instead.
Fix encoding error when updating with redirected output

When output is redirected sys.stdout.encoding is None. Fix this by
always encoding to utf-8, assuming gitlab handles that. The encoding
used by the local system is irrelevant here.
Merge pull request #27 from cdleonard/master

Fix encoding errors on display and update with redirected output