本帖最后由 aa77dd@163.com 于 2016-11-29 16:50 编辑
数据如此: 这是什么编码我完全不知道- 69,0,6E,0,6C,0,69,0,6E,0,65,0,3B,0,20,0,66,0,69,0,6C,0,65,0,6E,0,61,0,6D,0,65,0,3D,0,22,0,34,5A,AF,75,87,91,1C,94,3F,0,36,0,35,0,2E,0,72,0,61,0,72,0,2E,0,74,0,6F,0,72,0,72,0,65,0,6E,0,74,0,22,0,
复制代码 其中 34,5A,AF,75,87,91,1C,94,3F 按 UTF-16 LE 解码为 娴疯醇鐜
另外 ahk 也可以用
ComObjCreate("Msxml2.XMLHTTP")
之类
我觉得是 WinHttp 或者 VBS 的问题- Const adTypeBinary = 1
- Const adTypeText = 2
-
- ' accept a string and convert it to Bytes array in the selected Charset
- Function StringToBytes(Str,Charset)
- ' Dim Stream
- Set Stream = CreateObject("ADODB.Stream")
- Stream.Type = adTypeText
- Stream.Charset = Charset
- Stream.Open
- Stream.WriteText Str
- Stream.Flush
- Stream.Position = 0
- ' rewind stream and read Bytes
- Stream.Type = adTypeBinary
- StringToBytes= Stream.Read
- Stream.Close
- Set Stream = Nothing
- End Function
-
- ' accept Bytes array and convert it to a string using the selected charset
- Function BytesToString(Bytes, Charset)
- ' Dim Stream
- Set Stream = CreateObject("ADODB.Stream")
- Stream.Charset = Charset
- Stream.Type = adTypeBinary
- Stream.Open
- Stream.Write Bytes
- Stream.Flush
- Stream.Position = 0
- ' rewind stream and read text
- Stream.Type = adTypeText
- BytesToString= Stream.ReadText
- Stream.Close
- Set Stream = Nothing
- End Function
-
- ' This will alter charset of a string from 1-byte charset(as windows-1252)
- ' to another 1-byte charset(as windows-1251)
- Function AlterCharset(Str, FromCharset, ToCharset)
- Dim Bytes
- Bytes = StringToBytes(Str, FromCharset)
-
- AlterCharset = BytesToString(Bytes, ToCharset)
- End Function
-
-
- Set objWinHttp = CreateObject("WinHttp.WinHttpRequest.5.1")
- objWinHttp.Open "HEAD", "https://www.nyaa.se/?page=download&tid=613616"
- objWinHttp.Send
- MsgBox objWinHttp.GetResponseHeader("Content-Disposition")
- MsgBox LenB ( objWinHttp.GetResponseHeader("Content-Disposition") )
-
- HEXS=""
- for i = 1 to LenB(objWinHttp.GetResponseHeader("Content-Disposition"))
- HEXS = HEXS & hex(ascb(MidB (objWinHttp.GetResponseHeader("Content-Disposition"), i, 1))) & ","
- next
- MsgBox HEXS
-
-
- MsgBox AlterCharset( objWinHttp.GetResponseHeader("Content-Disposition"), "GB2312", "utf-8")
复制代码
|