Sumber daya yang dimuat... Pemuatan...

HttpQuery Bahasa Tionghoa Charset=GB18030

Penulis:18599999999, Dibuat: 2022-02-16 13:27:24, Diperbarui: 2022-02-16 13:48:21

Teman-teman, data yang dikembalikan server adalah GB18030 dan hasil permintaan cetak adalah sebagai berikut, apakah Anda bisa menyelesaikan masalah bahasa Cina menjadi kode acak?

{\cH00FFFF} Kode Status: 200, Header: { Cache-Control: [ no-cache ], Sambungan: [ Keep-Alive ], Content-Type: [ aplikasi/javascript; Charset=GB18030 ] {\cH00FFFF}, Cookies: [], Body: var hq_str_gb_$dji= ,34988.8398,1.22,2022-02-16 06:01:05,422.6700,34686.1914,35047.7891,34686.1914,36952.6484,30547.5293,305666649,370199515,0.00,,0.00,0.00,00.00,0.00,00.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0. {\cH00FFFF}


Lebih banyak

Penemu Kuantitas - Mimpi KecilKetika memanggil fungsi HttpQuery untuk mengirim permintaan Http, tentukan pengaturan karakter di kepala permintaan. Cobalah. "application/javascript; charset=xxx" diatur menjadi utf-8, misalnya.

Penemu Kuantitas - Mimpi KecilTidak sopan, terima kasih atas pertanyaan Anda.

18599999999Saya sangat senang dengan hasil ini.

Penemu Kuantitas - Mimpi KecilSetelah diuji, kami telah meng-upgrade administrator untuk menjawab pertanyaan Anda. `` fungsi main (() { var ret = HttpQuery (dalam bahasa Inggris) "https://hq.sinajs.cn/rn=1644985273291&list=gb_$dji,gb_ixic,gb_$inx,hf_GC,hf_CL,DINIW,s_sh000001,rt_hkHSI,b_NKY", {method: "GET", charset: GB18030"}, null, "Referer: https://stock.finance.sina.com.cn/usstock/quotes/.IXIC.html", benar (Inggris) Log (ret.Body) Aku tidak tahu. `` Jika Anda menggunakan host terbaru, maka kode ini akan di-debug untuk menampilkan karakter yang normal.

18599999999Apakah masalah ini bisa diselesaikan dengan kode? Atau bisa diselesaikan dalam waktu singkat?

18599999999Kode bisa dilihat di https://www.fmz.com/strategy/345557

Penemu Kuantitas - Mimpi KecilAnda harus melihat bagaimana kode Anda ditulis, httpQuery, dan konteksnya.

18599999999Saya mencoba menambahkan "Content-Type" di header: "application/javascript; charset=utf-8", atau tidak bisa (tidak tahu apakah ini benar atau tidak). Saya kira server hanya akan mengembalikan set karakter ini. Dan data keuangan yang dikeruk, mengubah header permintaan mungkin juga akan diidentifikasi.