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

  • Home
  • SEARCH
  • 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 7067833
In Process

The Archive Base Latest Questions

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

I’ve seen a number of posts that ask about using non-conforming Uris, but none

  • 0

I’ve seen a number of posts that ask about using non-conforming Uris, but none of them have a good answer. I’m writing a Windows Phone control and it needs to request ATOM data using HTTP GET. The URL needs to include the characters %3d (the equal sign) in it. This is non-negotiable as it’s a third-party service over which I have no control. Imagine a URL like the following:

http://host.com?arg1=val1&arg=val2%3d

I’m using WebClient with DownloadStringAsync, but it only accepts Uri objects, not URL in strings. The Uri object automatically unescapes those characters and sends:

http://host.com?arg1=val1&arg=val2=

This fails. There’s a deprecated constructor argument “UserExcaped” that is exactly what I need, but it’s not available. I fear that my only option is to implement my own string download method using a raw socket and minimal HTTP support.

Any other thoughts? Help is very much appreciated!!

UPDATE


    string apps = "http://blah.com/api?prev=AAAAAAA%3d&next=BBBBBBB";
    var u = new Uri(apps);
    string apps2 = u.ToString();
    Debug.Assert(apps == apps2); // That %3d will always be converted to an equals sign

I should also point out, that if I try to be clever by encoding the percent as %25 (so it’s “prev=AAAAAA%253d&next=BBBBB”) then I get that exact literal string with %25 still intact! It’s just %3d that it’s aggressive about converting to an equals sign.

  • 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-28T05:14:58+00:00Added an answer on May 28, 2026 at 5:14 am

    The Uri class is designed to be like that. MSDN:

    As part of canonicalization in the constructor for some schemes,
    escaped representations are compacted. The schemes for which URI will
    compact escaped sequences include the following: file, http, https,
    net.pipe, and net.tcp. For all other schemes, escaped sequences are
    not compacted.

    Have you tried using HttpWebRequest instead? It’s a bit more work than a WebClient, but it lets you pass a string as the destination.

    Edit – Another approach could be to create your own UriParser which allows the encoded version. An example of extending the UriParser can be found here.

    For others not running Windows Phone, you can use reflection to fix this.

    MethodInfo getSyntax = typeof(UriParser).GetMethod("GetSyntax", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic);
    FieldInfo flagsField = typeof(UriParser).GetField("m_Flags", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
    if (getSyntax != null && flagsField != null)
    {
       foreach (string scheme in new[] { "http", "https" })
       {
    
           UriParser parser = (UriParser)getSyntax.Invoke(null, new object[] { scheme });
           if (parser != null)
           {
               int flagsValue = (int)flagsField.GetValue(parser);
    
               //0x20000 is the SimpleUserSyntax attribute
               if ((flagsValue & 0x20000) != 0)
                  flagsField.SetValue(parser, flagsValue & ~0x20000);
           }
        }
    }
    
    
    Uri u = new Uri("http://host.com?arg1=val&arg=val2%3d");
    //At this point, the %3d remains as expected.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have thousands of HTML files to process using Groovy/Java and I need to
I have a bunch of posts stored in text files formatted in yaml/textile (from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.