コード例 #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);