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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:21:49+00:00 2026-06-03T02:21:49+00:00

I have a parameter which I must pass as part of a url. The

  • 0

I have a parameter which I must pass as part of a url. The parameter contains this character: ß

When I encode this string, I am expecting this: %DF
but instead i’m getting: %c3%9f

Here is a line of C# which I have been using to test

  string test = HttpUtility.UrlEncode("ß");
  • 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-06-03T02:21:52+00:00Added an answer on June 3, 2026 at 2:21 am

    This is because the default implementation of UrlEncode is based on the UTF8 character encoding. Actually this is entirely within your control.

    For example, the following code:

    string sample = new string((char)0x0DF, 1);
    string test = HttpUtility.UrlEncode(sample);
    Console.WriteLine("UTF8 Ecoded: {0}", test);
    test = HttpUtility.UrlEncode(sample, Encoding.GetEncoding(1252));
    Console.WriteLine("1252 Ecoded: {0}", test);
    

    Outputs the following:

    UTF8 Ecoded: %c3%9f
    1252 Ecoded: %df
    

    Of course the danger with using another encoding on a URI is that some characters can not be represented at all…

    for example, this code:

    string sample = new string((char) 312, 1);
    Encoding encoding = Encoding.GetEncoding(1252);
    string test = HttpUtility.UrlEncode(sample);
    Console.WriteLine("UTF8 Ecoded: {0}, round-trip = {1}", test, sample == HttpUtility.UrlDecode(test));
    test = HttpUtility.UrlEncode(sample, encoding);
    Console.WriteLine("1252 Ecoded: {0}, round-trip = {1}", test, sample == HttpUtility.UrlDecode(test, encoding));
    Console.ReadLine();
    

    Will output the following:

    UTF8 Ecoded: %c4%b8, round-trip = True
    1252 Ecoded: %3f, round-trip = False
    

    You can see in the later example the encoding is “%3f” which, when unencoded is equal to a question mark “?”, not the input character of 312 (0x138).

    In a nutshell there is nothing wrong with encoding “ß” as “%c3%9f”, to the contrary, it is the correct representation. Yet if you must have the encoding “%DF for the remote server to correctly decode it, then use the 1252 codepage as shown.

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

Sidebar

Related Questions

I have a function which accepts a string parameter such as: var1=val1 var2=val2 var3='a
i have a page called page1.jsf which contains one parameter. i have a command
I have a PL/pgSQL function which requires one input parameter which is the primary
i have a report that i have been sending a parameter to which worked
i have task which takes a parameter and has three modes of results Example
I have to write 3 functions which accepts a parameter of BaseClass type and
I have the following code which takes List of boolean as a parameter then
I have a variadic function which takes a float parameter. Why doesn't it work?
I have web page which is passing a querystring parameter to page 2: <a
I have a stored procedure which takes an XML parameter and inserts the data

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.