在写iphone 接口过程中乱码问题困惑了很久,经过一番周折终于找到了解决方案希望对大家有所帮助
/// <summary>
/// 对中文utf8 进行转换
/// </summary>
/// <param name="searchKey"></param>
/// <returns></returns>
public static string CheckCoding(string searchKey)
{
byte[] utfByte = Encoding.UTF8.GetBytes(searchKey);
string str = HttpUtility.UrlDecode(utfByte, System.Text.Encoding.UTF8);
return str;
}
本文分享了在处理iPhone接口过程中遇到乱码问题的解决办法,通过使用特定的编码转换方法,成功解决了问题。文章详细介绍了如何将中文utf8进行转换,包括使用编码转换函数和URL解码,确保文本正确显示。
387

被折叠的 条评论
为什么被折叠?



