Пример #1
0
        public void Utf8ToUtf16AsciiTest()
        {
            var expected = new char[] { (char)0x00, (char)0x7f, (char)0x3f };
            var bytes    = Encoding.UTF8.GetBytes(expected);
            var actual   = Utf8ToUtf16.ToUtf16Enumerable(bytes, 0).ToArray();

            Assert.Equal(expected, actual);
        }
Пример #2
0
        public void Utf8ToUtf16U10FFFFTest()
        {
            var expected = new char[] { (char)0xdbc0, (char)0xdc00, (char)0xdbc0, (char)0xdc30, (char)0xdbff, (char)0xdfff };
            var bytes    = Encoding.UTF8.GetBytes(expected);
            var actual   = Utf8ToUtf16.ToUtf16Enumerable(bytes, 0).ToArray();

            Assert.Equal(expected, actual);
        }