[Mono-bugs] [Bug 78703][Wis] New - String constructors that take sbyte* should use Encoding.Default rather than UTF-8 and Latin-1

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Jun 24 17:56:08 EDT 2006


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 kornelpal at gmail.com.

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

--- shadow/78703	2006-06-24 17:56:08.000000000 -0400
+++ shadow/78703.tmp.26661	2006-06-24 17:56:08.000000000 -0400
@@ -0,0 +1,31 @@
+Bug#: 78703
+Product: Mono: Runtime
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: kornelpal at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: String constructors that take sbyte* should use Encoding.Default rather than UTF-8 and Latin-1
+
+Currently new string(sbyte*) uses UTF-8 and new string(sbyte*, int, int) 
+uses Latin-1 that is incorrect and in addition inconsistent.
+
+Both of them should use Encoding.Default.
+
+MSDN Documentation states the following:
+
+The value parameter is assumed to point to an array representing a string 
+encoded in ASCII; that is, the string is encoded using the ANSI code page.
+
+This is a nonsense as ASCII is a specific code page while ANSI code page 
+is CP_ACP. But even according the documentation it's Encoding.Default. 
+(MS.NET probably uses MultiByteToWideChar with CP_ACP.)


More information about the mono-bugs mailing list