add non-ascii support and delete useless space