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 [EMAIL PROTECTED]

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

--- shadow/78703        2006-07-15 17:04:09.000000000 -0400
+++ shadow/78703.tmp.26917      2006-07-15 17:14:09.000000000 -0400
@@ -53,6 +53,28 @@
 Unamanged code (.c files) differ in that the second one uses a 
 wrapper while the first one directly maps .ctor to CreateString.
 
 Note that the first patch was approved by Zoltán while the second 
 one was not commented by anyone yet. I'm waiting for his response 
 which marshal.c code of these two does he prefer.
+
+------- Additional Comments From [EMAIL PROTECTED]  2006-07-15 17:14 -------
+A test is as easy as calling the constructor with a pointer. I'll 
+provide a test but because it uses Encoding.Default (that is CP_ACP 
+or GetACP() on Windows) both the actual and the expected result 
+depend on the selected ANSI code page.
+
+string s = "something\0";
+byte[] b = Encoding.Default.GetBytes(s);
+
+fixed (byte* p = b) {
+       Console.WriteLine(new string((sbyte*)p));
+       Console.WriteLine(new string((sbyte*)p, 0, b.Length));
+}
+
+Note that you should use some string that is specific to the ANSI 
+encoding instead of "something" to verify that these constructors 
+use ANSI code page. NULL termination is required by the first 
+constructor.
+
+The above referenced MSDN documentation verifies this behavior as 
+well.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to