- p
- A IntPtr containing the address of an unmanaged string in the encoding encoding.
- encoding
- A System.Text.Encoding specifying which encoding p is in.
A string containing a copy of the unmanaged string p, or null if p is IntPtr.Zero.
Type Reason ArgumentNullException encoding is null.
The input string p must have a terminating null. The definition of "terminating null" is fluid in this context, since the size of a terminating null depends upon the encoding specified.
A terminating null is a single byte containing the value 0x00 if encoding is one of the following encodings: System.Text.ASCIIEncoding, System.Text.UTF8Encoding, System.Text.UTF7Encoding, or Mono.Unix.UnixEncoding.
A terminating null is the short value 0x0000 if encoding is System.Text.UnicodeEncoding.
Otherwise, the terminating null must consist of a sequence of System.Text.Encoding.GetMaxByteCount(1) bytes having the value 0x00.
Any buffer returned by UnixMarshal.StringToHeap will satisfy this requirement.