detect input encoding
Fix completion on mail for upshare command