Example #1
0
        public static bool TestUTF16Hex()
        {
            var x = new Random().Next(1, 254);
            var s = x.ToString("x");

            if (UTF16.ConvertToHex((char)x) == s)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #2
0
        public static bool TestUTF16Binary()
        {
            var x = new Random().Next(1, 254);
            var s = Convert.ToString((char)x, 2);

            if (UTF16.ConvertToBinary((char)x).ToString() == s)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }