[英]C# - Convert UTF8 String into bits, modify bits, and convert back into UTF8 String
[英]C# ASP convert parameters to utf8
我的應用程序有問題,我的一位客戶以錯誤的格式向我發送數據,因此我必須先將其解碼為 utf8。
羅布%FCh
這個“%FC”是 ISO-8859-1 中的“ü”
但我在我的應用程序中得到的只是
羅特比
我不能再對其進行編碼了……在數據轉換甚至 url 編碼之前,控制器是否有過濾器可以執行此操作?
public ActionResult Register(string adressXML)
謝謝。
解決方案是像這樣解析post數據:
string data = new System.IO.StreamReader(Request.InputStream).ReadToEnd();
string xmlData = System.Web.HttpUtility.UrlDecode(data, Encoding.GetEncoding("ISO-8859-1"));
然后我可以將字符串轉換為 utf8
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.