fix unicode compatibility error when variable `pretty' contains Chinese characters