C#HttpUtility.UrlEncode大写问题

C#中HttpUtility.UrlEncode返回的url编码是小写的,但未处理的java是大写的

		public static string UrlEncode(string str)
        {
            StringBuilder sb = new StringBuilder();
            foreach (char c in str)
            {
                if (HttpUtility.UrlEncode(c.ToString()).Length > 1)
                {
                    sb.Append(HttpUtility.UrlEncode(c.ToString()).ToUpper());
                }
                else
                {
                    sb.Append(c);
                }
            }
            return sb.ToString();
        }

你可能感兴趣的:(后端)