String owner= request.getParameter("owner");//上传人
if(owner==null)
{owner="";
}
byte b[]=owner.getBytes("ISO-8859-1");
owner=new String(b);
最主要的就是这句byte b[]=owner.getBytes("ISO-8859-1");
来源于http://community.youkuaiyun.com/Expert/topic/3599/3599368.xml?temp=.1656305
博客展示了一段Java代码,从请求中获取上传人信息,若信息为空则置空字符串,接着将字符串按ISO - 8859 - 1编码转换为字节数组,再将字节数组转换回字符串,重点强调了编码转换这一操作。
365





