public static UtfAllString Create(Utf8Memory utf8String)
        {
            string utf16String = utf8String.ToString();

            string utf16EscapedString = JsonConvert.ToString(utf16String);

            utf16EscapedString = utf16EscapedString.Substring(1, utf16EscapedString.Length - 2);

            Utf8Memory utf8EscapedString = Utf8Memory.UnsafeCreateNoValidation(Encoding.UTF8.GetBytes(utf16EscapedString));

            return(new UtfAllString(utf8String, utf16String, utf8EscapedString, utf16EscapedString));
        }
Example #2
0
        public static UtfAllString Create(Utf8Memory utf8String)
        {
            string utf16String = utf8String.ToString();

            return(new UtfAllString(utf8String, utf16String));
        }