Chinese input not work well

when write with chinese, the count of words is always zero, so that the "write" function will be error.