java编码转换问题
如果
String testStr=URLDecoder.decode("%E6%B5%8B%E8%AF%95%E6%8E%A5%E5%8F%A3","utf-8");
则testStr="测试接口"
否则如果
String testStr=URLDecoder.decode("%E6%B5%8B%E8%AF%95%E6%8E%A5%E5%8F%A3","gb2312");
则testStr=“娴?璇???ュ?? ”
问:
采用第二种方式之后,如何把testStr中的乱码还原,即="测试接口"