[Mono-bugs] [Bug 65480][Min] New - Textbox.Text is double converting text to UTF-8 in codebehind

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 7 Sep 2004 16:56:44 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by rafaelteixeirabr@hotmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=65480

--- shadow/65480	2004-09-07 16:56:44.000000000 -0400
+++ shadow/65480.tmp.7562	2004-09-07 16:56:44.000000000 -0400
@@ -0,0 +1,160 @@
+Bug#: 65480
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: RH9
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: Sys.Web
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: rafaelteixeirabr@hotmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Textbox.Text is double converting text to UTF-8 in codebehind
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+When changing the Text property on codebehind, of a
+System.Web.UI.WebControls.TextBox to some text containing accented
+characters, they get doubly-converted, outputting garbage
+
+Steps to reproduce the problem:
+1. Page source : cadastro.aspx
+
+<%@ Page Language="c#" Inherits="cadastro.cadaluno" ResponseEncoding="utf-8" %>
+<html>
+        <HEAD>
+                <title>Test</title>
+                <meta name="GENERATOR" Content="gedit">
+                <meta name="CODE_LANGUAGE" Content="C#">
+        </HEAD>
+        <body>
+                <form id="Test" method="post" runat="server">
+                        <P>
+                                <asp:TextBox id="editNome"
+runat="server">Olá Mundo</asp:TextBox></P>
+                        <P>
+                                <asp:Button id="SubmitButton"
+runat="server" Text="Submit"></asp:Button></P>
+                </form>
+        </body>
+</html>
+
+
+2. CodeBehind Source : cadastro.aspx.cs
+
+using System;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace cadastro {
+	public class cadaluno : System.Web.UI.Page
+	{
+		protected TextBox editNome;
+
+		protected override void OnLoad(EventArgs args)
+		{
+			base.OnLoad(args);
+			if (IsPostBack)
+              			editNome.Text = "Olá Mundo Cão!";
+		}
+	}
+}
+
+3. compile the codebehind
+
+ mcs -r:System.Web -t:library -out:bin/cadastro.dll cadastro.aspx.cs
+
+
+4. start xsp and navigate to cadastro.aspx
+
+5. press the button: Then it Bangs!
+
+Actual Results:
+
+Initially appears
+<html>
+        <HEAD>
+                <title>Test</title>
+                <meta name="GENERATOR" Content="gedit">
+                <meta name="CODE_LANGUAGE" Content="C#">
+        </HEAD>
+        <body>
+                <form name="Test" method="post" action="cadastro.aspx"
+enctype="" id="Test">
+<input type="hidden" name="__VIEWSTATE"
+value="DA0ADgEFAQ4BDQAOAgUBBQMOAg0MDA4BAQdFbmFibGVkDgEIAAAADQwMDgECAAAOAQgAAAAA"
+/>
+
+                        <P>
+                                <input name="editNome" value="Olá Mundo"
+type="text" id="editNome" /></P>
+                        <P>
+                                <input type="submit" name="SubmitButton"
+value="Submit" id="SubmitButton" /></P>
+                </form>
+        </body>
+</html>
+
+after pressing the SubmitButton it comes back as
+
+<html>
+        <HEAD>
+                <title>Test</title>
+                <meta name="GENERATOR" Content="gedit">
+                <meta name="CODE_LANGUAGE" Content="C#">
+        </HEAD>
+        <body>
+                <form name="Test" method="post" action="cadastro.aspx"
+enctype="" id="Test">
+<input type="hidden" name="__VIEWSTATE"
+value="DA0ADgEFAQ4BDQAOAgUBBQMOAg0MDA4BAQdFbmFibGVkDgEIAAAADQwMDgECAAAOAQgAAAAA"
+/>
+
+                        <P>
+                                <input name="editNome" value="Olá Mundo
+Cão!" type="text" id="editNome" /></P>
+                        <P>
+                                <input type="submit" name="SubmitButton"
+value="Submit" id="SubmitButton" /></P>
+                </form>
+        </body>
+</html>
+
+Expected Results:
+
+<html>
+        <HEAD>
+                <title>Test</title>
+                <meta name="GENERATOR" Content="gedit">
+                <meta name="CODE_LANGUAGE" Content="C#">
+        </HEAD>
+        <body>
+                <form name="Test" method="post" action="cadastro.aspx"
+enctype="" id="Test">
+<input type="hidden" name="__VIEWSTATE"
+value="DA0ADgEFAQ4BDQAOAgUBBQMOAg0MDA4BAQdFbmFibGVkDgEIAAAADQwMDgECAAAOAQgAAAAA"
+/>
+
+                        <P>
+                                <input name="editNome" value="Olá Mundo
+Cão!" type="text" id="editNome" /></P>
+                        <P>
+                                <input type="submit" name="SubmitButton"
+value="Submit" id="SubmitButton" /></P>
+                </form>
+        </body>
+</html>
+
+How often does this happen? 
+
+Always
+
+Additional Information: