D
darin dimitrov
Hello,
How can I convert an url encoded string containing some french
characters back to the original string?
I have the following html form:
<form>
name = <input type="text" name="name" value="Noël Pirès"/>
<input type="submit" value="OK"/>
</form>
When I submit this form the following data is sent at protocol level
using HTTP GET: name=No%EBl+Pir%E8s
I tried converting it with the HttpUtility.UrlDecode method in order
to obtain the original string but with no success. This method
returned
"name=Nol Pirs" and the special french characters are omitted. What
function should I use in order to decode such a string.
In fact I would like to implement the following: I have a text file
containing the urlencoded string and in a console application I want
to make the conversion, something like:
------------------------
FileStream fin = new FileStream(@"c:\test.txt", FileMode.Open,
FileAccess.read);
byte[] buf = new byte[fin.Length];
fin.Read(buf, 0, (int)buf.Length);
string s = Encoding.Default.GetString(buf);
s = HttpUtility.UrlDecode(s);
System.Console.Write(s);
How can I convert an url encoded string containing some french
characters back to the original string?
I have the following html form:
<form>
name = <input type="text" name="name" value="Noël Pirès"/>
<input type="submit" value="OK"/>
</form>
When I submit this form the following data is sent at protocol level
using HTTP GET: name=No%EBl+Pir%E8s
I tried converting it with the HttpUtility.UrlDecode method in order
to obtain the original string but with no success. This method
returned
"name=Nol Pirs" and the special french characters are omitted. What
function should I use in order to decode such a string.
In fact I would like to implement the following: I have a text file
containing the urlencoded string and in a console application I want
to make the conversion, something like:
------------------------
FileStream fin = new FileStream(@"c:\test.txt", FileMode.Open,
FileAccess.read);
byte[] buf = new byte[fin.Length];
fin.Read(buf, 0, (int)buf.Length);
string s = Encoding.Default.GetString(buf);
s = HttpUtility.UrlDecode(s);
System.Console.Write(s);