Link to home
Start Free TrialLog in
Avatar of fpasquier
fpasquier

asked on

How to define charset of UrlEncode ?

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.
ASKER CERTIFIED SOLUTION
Avatar of mmarinov
mmarinov

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of fpasquier
fpasquier

ASKER

Ok, thanks a lot!!!! It works.