Пример #1
0
        private unsafe string AsString(char *input, bool release = true)
        {
            string text = Encoding.UTF8.GetString(Encoding.Unicode.GetBytes(new string(input)));

            if (text.Contains('\0'))
            {
                text = text.Substring(0, text.IndexOf('\0'));
            }
            if (release)
            {
                if (_isWin)
                {
                    WinInterop.tdReleaseString(input);
                }
                else
                {
                    LinuxInterop.tdReleaseString(input);
                }
            }
            return(text);
        }