String urlencoder =”要进行编码的内容”
String str=URLEncoder.encode(urlencoder,"UTF-8"); //采用UTF-8编码格式,将字符串urlencoder进行URL编码,返回一个字符串,然后赋值给变量str
vars.put("str",str); //将通过URL编码后的变量值str赋值给jmeter的变量str
log.info(str); //在jmeter的控制台中输出变量值str
//String str=URLEncoder.Decode(urlencoder,"UTF-8"); //对字符串进行URL解码,返回已解码的字符串