[Mono-bugs] [Bug 69106][Maj] New - TextInfo constructor

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 4 Nov 2004 15:07:57 -0500 (EST)


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 juancri@tagnet.org.

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

--- shadow/69106	2004-11-04 15:07:57.000000000 -0500
+++ shadow/69106.tmp.29388	2004-11-04 15:07:57.000000000 -0500
@@ -0,0 +1,50 @@
+Bug#: 69106
+Product: Mono: Class Libraries
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: juancri@tagnet.org               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: TextInfo constructor
+
+TextInfo has two constructor. The constructor with NO parameters [textInfo
+()] is used only by CultureInfo:ConstructInvariant method. When this empty
+constructor is used, the private fields "ci" (culture info) and
+"m_win32LangID" are never used! That causes errors doing this:
+
+string text = "Hi, this is a TeSt";
+string lower = CultureInfo.InvariantCulture.TextInfo.ToLower (text);
+
+===
+result: 
+
+Unhandled Exception: System.ArgumentNullException: Argument cannot be null.
+Parameter name: culture
+in <0x0003b> System.String:ToLower (System.Globalization.CultureInfo)
+in <0x0004b> System.Globalization.TextInfo:ToLower (string)
+in <0x0002e> Test:Main ()
+==
+
+Because the TextInfo of InvariantCulture is being constructed using the
+empty  constructor.
+
+The CultureInfo:ConstructInvariant method calls the constructor by this way:
+
+textinfo=new TextInfo ();
+
+It shoould be:
+
+textinfo=new TextInfo (this, cultureID);
+
+That fixes the error. Yo should also delete the constructor with no parametes.
+
+:)