Exemplo n.º 1
0
 public static void validateEncoderAgainstDecoder()
 {
     XNMD.UTF8Decoder decoder = new XNMD.UTF8Decoder();
     for (uint i = 0; i <= 0x10ffff; i++)
     {
         byte[]            bytes   = EncodeCodePoint(i);
         UTF8DecodeContext context = decoder.DecodeBytes(bytes)[0];
         if ((context.Codepoint != i) && (context.Status == UTF8StatusCode.None))
         {
             Console.Out.Write("Codepoint {0} messed up", i);
         }
     }
 }
Exemplo n.º 2
0
 public static void validateEncoderAgainstDecoder()
 {
     XNMD.UTF8Decoder decoder = new XNMD.UTF8Decoder();
     for (uint i = 0; i <= 0x10ffff; i++)
     {
         byte[] bytes = EncodeCodePoint(i);
         UTF8DecodeContext context = decoder.DecodeBytes(bytes)[0];
         if ((context.Codepoint != i) && (context.Status == UTF8StatusCode.None))
         {
             Console.Out.Write("Codepoint {0} messed up", i);
         }
     }
 }