[Mono-bugs] [Bug 484795] New: WebClient.UploadValues using UTF-8 encoding and "POST" method do not upload accented characters properly

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Mar 12 11:28:26 EDT 2009


https://bugzilla.novell.com/show_bug.cgi?id=484795


           Summary: WebClient.UploadValues using UTF-8 encoding and "POST"
                    method do not upload accented characters properly
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 1.9
          Platform: x86
        OS/Version: Kubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: galaddev at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; fr; rv:1.9.0.7)
Gecko/2009021910 Firefox/3.0.7 (.NET CLR 3.5.30729)

When I want to user the method WebClient.UploadValues, with an UTF-8 encoding,
all accented characters become '?'. The web page uses UTF-8 and it works fine
with the .NET framework.

Reproducible: Always

Steps to Reproduce:
1.Create a new instance of WebClient
2.Set the encoding to UTF-8
3.Upload accented value using "POST" method to a web page.
Here is an exemple :
WebClient wc = new WebClient();
NameValueCollection nv = new NameValueCollection();
nv.Add("test", "plop éé");
wc.Encoding = System.Text.Encoding.UTF8;
byte[] result = wc.UploadValues("http://galaid.free.fr/testmono.php", "POST",
nv);
Console.WriteLine(System.Text.Encoding.UTF8.GetString(result));
Actual Results:  
ééé
plop ??

Expected Results:  
ééé
plop éé

Here is the php code of testmono.php :
print(utf8_encode("ééé"));
print("\n");
print($_POST["test"]);

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list