go中怎么实现类似php的rawurlencode和rawurldecode
1个回答
展开全部
方法:
public String unescapeUnicode(String str){
StringBuffer b=new StringBuffer();
Matcher m = Pattern.compile("\\\\u([0-9a-fA-F]{4})").matcher(str);
while(m.find())
b.append((char)Integer.parseInt(m.group(1),16));
return b.toString();
}
public String unescapeUnicode(String str){
StringBuffer b=new StringBuffer();
Matcher m = Pattern.compile("\\\\u([0-9a-fA-F]{4})").matcher(str);
while(m.find())
b.append((char)Integer.parseInt(m.group(1),16));
return b.toString();
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询