1 Encoding gb2312 = Encoding.GetEncoding("gb2312"); 2 Encoding utf8 = Encoding.UTF8; 3 //首先用utf-8進行解碼 4 string key = HttpUtility.UrlDecode(oStr, utf8); 5 // 將已經解碼的字符再次進行編碼. 6 string encode = HttpUtility.UrlEncode(key, utf8).ToLower();
1 Encoding gb2312 = Encoding.GetEncoding("gb2312"); 2 Encoding utf8 = Encoding.UTF8; 3 //首先用utf-8進行解碼 4 string key = HttpUtility.UrlDecode(oStr, utf8); 5 // 將已經解碼的字符再次進行編碼. 6 string encode = HttpUtility.UrlEncode(key, utf8).ToLower();
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。