Exemplo n.º 1
0
        public static DetectBit check(byte[] text, long limitlen)
        {
            if (IsAscii(text, limitlen))
            {
                return(DetectBit.ALL);
            }
            DetectBit detect = DetectBit.NONE;

            if (IsShiftJis(text, limitlen))
            {
                detect |= DetectBit.ShiftJIS;
            }
            if (IsUtf8(text, limitlen))
            {
                detect |= DetectBit.UTF8;
            }
            return(detect);
        }
Exemplo n.º 2
0
 public static bool IsAscii(DetectBit bit) => ((bit & DetectBit.ASCII) != 0);
Exemplo n.º 3
0
 public static bool IsUtf8(DetectBit bit) => ((bit & DetectBit.UTF8) != 0);
Exemplo n.º 4
0
 public static bool IsShiftJis(DetectBit bit) => ((bit & DetectBit.ShiftJIS) != 0);