Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to define charset of UrlEncode ?

Posted on 2004-09-22
2
Medium Priority
?
1,433 Views
Last Modified: 2010-05-18
I have a problem when I use the method Server.UrlEncode in ASP.NET (c#)
I would like to use this method to encode characters in iso-8859-1.
For some reason, I have to send a request to a web server in ISO-8859-1 and not in UTF-8. And I have the impression this method encodes all non-ASCII characters in 2-bytes codes. How to force it to encode in iso-8859-1.
For exemple, Server.UrlEncode("é")  returns  %c3%a9
But  I would like to get :   %E9
I need the feature to be dynamic. Sometimes, it can also be windows-1251 or any others.
0
Comment
Question by:fpasquier
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 28

Accepted Solution

by:
mmarinov earned 1000 total points
ID: 12125628
Hi,

use
HttpUtility.UrlEncode (this.Request.Url.PathAndQuery, System.Text.Encoding.GetEncoding("iso-8859-1"));

i'm not sure just if this is the code of the page you should enter - iso-8859-1

HTH
Regards,
B..M
0
 

Author Comment

by:fpasquier
ID: 12125987
Ok, thanks a lot!!!! It works.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question