예제 #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);
        }
예제 #2
0
 public static bool IsAscii(DetectBit bit) => ((bit & DetectBit.ASCII) != 0);
예제 #3
0
 public static bool IsUtf8(DetectBit bit) => ((bit & DetectBit.UTF8) != 0);
예제 #4
0
 public static bool IsShiftJis(DetectBit bit) => ((bit & DetectBit.ShiftJIS) != 0);