chinese input support, kbuf malloc and free little change