Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Url encoding with French Character

i need to pass special characters trough the webservice. i used the code

HttpUtility.UrlEncode("french character")

but the encoding is not working correctly if the string contains a double Quots

eg: HttpUtility.UrlEncode("é")

it encodes fine. but not decodes properly

......Thank in advance ......

like image 338
Shebin Avatar asked May 02 '11 13:05

Shebin


2 Answers

Url encoding of the french character é is %E9

when we use

HttpUtility.UrlEncode("é")

we get the output as %c3%a.

HttpUtility.UrlEncode("é", System.Text.Encoding.GetEncoding("ISO-8859-1")

gives the correct encoded output ie %E9

like image 118
Shebin Avatar answered Sep 30 '22 05:09

Shebin


I don't see what your problem is. This code:

Console.WriteLine(System.Web.HttpUtility.UrlEncode("something enclosed \"in quotes\""));

outputs this result:

something+enclosed+%22in+quotes%22

just as it should, without the \ character. So what's the problem, exactly?

like image 27
qJake Avatar answered Sep 30 '22 06:09

qJake