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 625127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:16:33+00:00 2026-05-13T19:16:33+00:00

My problem is with .Net Http/Uri libraries not being able to decode or unescape

  • 0

My problem is with .Net Http/Uri libraries not being able to decode or unescape this character sequence: “Hi%E1”.
Neither Uri.UnescapeDataString nor HttpUtility.UrlDecode can do it.

Although I have a solution to get around this problem ( URL decoding confusion ) I would like to understand why it is failing.

The 1st test here throws an exception! The second just fails.

Assert.That(Uri.UnescapeDataString("Hi%E1"), Is.EqualTo("Hiá"));
HttpUtility.UrlDecode("Hi%E1").ShouldBe("Hiá");

There is nothing in the docs to indicate that UnescapeDataString or UrlDecode are restricted to character sets or any reason why these tests would fail. However, from testing, it would appear that HttpUtility assumes UTF-8 (or some other) encoding.

The Java equivalent works! Probably because it allows an encoding to be set.

URLDecoder.decode("Hi%E1","windows-1252");    // this works btw, ie passes tests

Which looks like a very sensible move considering the .Net work-around (see URL above)

Are the .Net implementations of these methods just crap and .Net devs just have to write their own – or am I missing something?

BTW Everything I know of in IIS set to UTF-8, and Chinese/Japanese characters show fine, so I don’t yet know how it could it be that this URI consists of windows-1252 encoded characters. If I could fix the URI to contain UTF-8 encoding, that would be a better way of fixing this.

  • 1 1 Answer
  • 2 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-13T19:16:33+00:00Added an answer on May 13, 2026 at 7:16 pm

    According to this you can also set the encoding using the HttpUtility.UrlDecode.

    Although, that seems to simple if you’re running into problems… just making sure you saw the overload.

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

Sidebar

Related Questions

I have isolated my problem in this fiddle http://jsfiddle.net/xYphz/ It uses the root model
You can see the example here: http://jsfiddle.net/8EHED/8/ This is a tricky problem because I
This is my fiddle code http://jsfiddle.net/coderslay/WnC9B/44/ It is successfully plotting the graph. The problem
Hy, my problem is this http://jsfiddle.net/VZ2MK/1/ (function(){ var input = $('.test').clone(); $('a.add_input').on('click', function(e){ $(this).before(input);
I have the following problem: http://jsfiddle.net/DerNa/12/ Which is demonstrated more clearly the jump here:
I've made a fiddle from my problem http://jsfiddle.net/bYMGZ/7/ The first popup displays from pressing
http://jsfiddle.net/q8P7Y/ I have a problem of showing the final score at the end, there
Here is a sample fiddle: http://jsfiddle.net/K2zyU/4/ The problem I am experiencing is that the
I have essentially the same problem discussed here: http://khason.net/blog/dependency-property-getters-and-setters-in-multithreaded-environment/ public static readonly DependencyProperty MyPropertyProperty
I've created an example of the problem here: http://jsfiddle.net/JustinN/qWeLT/1/ My actual code is hooked

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.