iT邦幫忙

0

關於URL code 中文編碼問題

大家好

網站的環境
IIS / asp / big5 (Session.CodePage=950)
瀏覽器chrome
search.asp?k=門

我的問題是:
若在網址列直接執行 search.asp?k=門 , 相同網頁接值後是亂碼 ,
目前是用JS先接值 , decodeURIComponent() , 然後再傳一次 ,
接值就不是亂碼了 .

ASP接值的狀況
request(k) => response.write 亂碼
Server.UrlEncode (request(k)) = %3F%80

JS接值 (decodeURIComponent (QueryString("k"))
再送出 window.location.href =search.asp
ASP接值 : request(k) 是 %AA%F9 (response.write 是 "門")

請問是否有在網址列直接執行search.asp?k=門 , 接值不是亂碼?

另一問題 : 如何將中文轉換這三種編碼?

%3F%80
%E9%96%80
%AA%F9

先謝謝大家!

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

0
黃彥儒
iT邦高手 1 級 ‧ 2018-04-20 15:12:56

Google Punycode 轉碼

我要發表回答

立即登入回答