Rewrite lsmcat to decode input using chardet