Fix encoding error when piping to utilities like cowsay in OS X. Thanks @mstringer