Example #1
0
        private static unsafe IntPtr CharsToPtr(Encoding encoding, char *chars, int count)
        {
            int    bufferLength = encoding.GetByteCount(chars, count);
            IntPtr ptr          = Sass_Api.sass_alloc_memory(bufferLength + 1);
            var    pBuffer      = (byte *)ptr;

            encoding.GetBytes(chars, count, pBuffer, bufferLength);
            pBuffer[bufferLength] = 0;

            return(ptr);
        }