fix charset bugs,and add set character in self_connect