这个问题很常见,有事明明客户端和服务器都制定好的编码格式"UTF-8",可就是发送到服务器后乱码。解决它很简单,直接手动编码解码就行。
例如客户端向服务器发送文本信息,要对文本信息进行编码: URLEncoder.encode(str,"UTF-8");
服务器接收后进行解码:URLDecoder.decode(str,"UTF-8");