How to resolve the messy code

hello,I am try to send a section characters in chinese,from server to client ,use net.conn,but client recieve messy code,how to solver,how to convert the code?Is there a charset translate package?thank you

You need to show some code that illustrates the problem, otherwise it’s almost impossible to guess what the problem might be.

oh,thank you!the simple code is:

this func try to send msg to zmud client,the client is connect my server use tcp telnet,now,i use conn.write a section chinese to client in code,but on client,i see messy code,not chinese.where is problem?

func Login(args []string, conn net.Conn) int {

msg := "您已经成功登陆!\n"  //chinese 

_, err := conn.Write([]byte(msg))

if err != nil {
	fmt.Println(err.Error())
	return 1
}

return 0

}

Maybe the other side isn’t expecting UTF-8…

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.