Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7627531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:28:20+00:00 2026-05-31T05:28:20+00:00

Possible Duplicate: .net UrlEncode – lowercase problem I’m using the HttpUtility.UrlEncode method to encode

  • 0

Possible Duplicate:
.net UrlEncode – lowercase problem

I’m using the HttpUtility.UrlEncode method to encode a string for me. The problem is that the letters in the encoded places are in lower case for example:

a colon(:) becomes %3a rather than %3A.

Not so much of an issue until I come to encrypt this string. The end result I want looks like this.

zRvo7cHxTHCyqc66cRT7AD%2BOJII%3D

If I use capital letters I get this

zRvo7cHxTHCyqc66cRT7AD+OJII=

which is correct, but if I use lower case letters (ie use UrlEncode rather than a static string) I get this

b6qk+x9zpFaUD6GZFe7o1PnqXlM=

Which is obviously not the string I want. Is there a simple way to make the encoded characters capital without reinventing the wheel of UrlEncoding?

Thnaks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:28:20+00:00Added an answer on May 31, 2026 at 5:28 am

    Sure, CAP the string before you encode it. Encoding is generally a one way street based on literal character values so it is no wonder result it different. I do wonder though, what type of value are you using this for? There most certainly is a better way to handle the type of data you’re encoding.

    An addition to the linked duplicate:

    public static string UpperCaseUrlEncode(this string s)
    {
        char[] temp = HttpUtility.UrlEncode(s).ToCharArray();
        for (int i = 0; i < temp.Length - 2; i++)
        {
            if (temp[i] == '%')
            {
                temp[i + 1] = char.ToUpper(temp[i + 1]);
                temp[i + 2] = char.ToUpper(temp[i + 2]);
            }
        }
        return new string(temp);
    }
    

    Turning it into an extension method allows any string variable to be UPPER CASE URL Encoded.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Using ASP.NET Controls without databinding My previous question yielded few results so
Possible Duplicate: Yield In VB.NET In C#, when writing a function that returns an
Possible Duplicate: .NET: Determine the type of this class in its static method How
Possible Duplicate: VB.NET Function Return If I have a function that returns a boolean,
Possible Duplicate: .NET String to byte Array C# How do I convert String to
Possible Duplicate: ASP.Net and GetType() I ran into a slight problem today. As you
Possible Duplicate: Asp.net how to correct the error I'm designing my web page using
Possible Duplicate: .Net Changes the element IDs I have the following problem (I'll explain
Possible Duplicate: .Net Console Application that Doesn’t Bring up a Console I have a
Possible Duplicate: .NET & Tab-Delimited files I have a list that has 2 columns:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.