public static void main(String[] args) throws UnsupportedEncodingException { String encodeUrl = URLEncoder.encode("BF+01601RG-1", "UTF-8");//编码 System.out.println(encodeUrl);//BF%2B01601RG-1 String decodeUrl = URLDecoder.decode("BF%2B01601RG-1", "UTF-8");//解码 System.out.println(decodeUrl);//BF+01601RG-1 }