Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Utf8EncodeNullable()

static unsafe byte * nativefiledialog.Utf8EncodeNullable ( string str)
inlinestaticprivate

Definition at line 30 of file nativefiledialog.cs.

31 {
32 if (str == null)
33 {
34 return null;
35 }
36 int num = Utf8Size(str);
37 byte* ptr = (byte*)(void*)Marshal.AllocHGlobal(num);
38 fixed (char* chars = str)
39 {
40 Encoding.UTF8.GetBytes(chars, (str != null) ? (str.Length + 1) : 0, ptr, num);
41 }
42 return ptr;
43 }
static IntPtr AllocHGlobal(int cb)
Definition Marshal.cs:625
static Encoding UTF8
Definition Encoding.cs:526
static int Utf8Size(string str)

References System.Runtime.InteropServices.Marshal.AllocHGlobal(), System.chars, System.str, System.Text.Encoding.UTF8, and Utf8Size().

Referenced by NFD_OpenDialog(), NFD_OpenDialogMultiple(), NFD_PickFolder(), and NFD_SaveDialog().