public static string GetStringFromBlob(IDxcLibrary library, IDxcBlob blob) { unsafe { blob = library.GetBlobAstUf16(blob); return(new string(blob.GetBufferPointer(), 0, (int)(blob.GetBufferSize() / 2))); } }
public static IDxcBlobEncoding CreateBlobForText(IDxcLibrary library, string text) { if (string.IsNullOrEmpty(text)) { return(null); } const uint CP_UTF16 = 1200; return(library.CreateBlobWithEncodingOnHeapCopy(text, (uint)(text.Length * 2), CP_UTF16)); }