日期:2014-05-17  浏览次数:20409 次

XMLHTTP返回值的问题
代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> 
<% 
Dim objXMLHTTP, xml
Set xml = Server.CreateObject("Msxml2.ServerXMLHTTP.3.0")

xml.Open "GET", "https://pcs.baidu.com/rest/2.0/file?***********", False 
' Pull the data from the web page 
xml.Send 

Response.Write xml.responseText

Set xml = Nothing 
%>

页面输出结果为:
{"list":[{"fs_id":3296763411,"path":"\/apps\/\u6d4b\u8bd5\u5e94\u7528\/CMISDATA\/Music\/Mp4\/\u7b14\u8bb0\u672c_\u6cd5\u5b9a\u5047\u671f\u7248.jpg","ctime":1352268081,"mtime":1352268081,"md5":"de72e9f3010c648bc30e20da90330388","size":3473548,"isdir":0}],"request_id":1745176748}

其中,path的正确值应为“/Apps/测试应用/CMISDATA/Music/Mp4/笔记本_法定假期版.jpg”

请问大家:如果对返回结果中的path解码呢?
------解决方案--------------------
参照 escape 和 unescape. 如果将就效率,请自行定义特殊符号转换的方法.
------解决方案--------------------
\u6d4b: 已知这是“测”字的unicode编码