예제 #1
0
        // Token: 0x06000A73 RID: 2675 RVA: 0x0003E3B8 File Offset: 0x0003C5B8
        public int GetCodePage(int[] codePagePriorityList, bool allowCommonFallbackExceptions, bool allowAnyFallbackExceptions, bool onlyValidCodePages)
        {
            uint num = uint.MaxValue;

            for (int i = 0; i < this.maskMap.Length; i++)
            {
                if (this.maskMap[i] != 0)
                {
                    uint num2 = CodePageDetectData.codePageMask[i];
                    if (allowAnyFallbackExceptions || (allowCommonFallbackExceptions && (CodePageDetectData.fallbackMask[i] & 1U) != 0U))
                    {
                        num2 |= (CodePageDetectData.fallbackMask[i] & 4294967294U);
                    }
                    num &= num2;
                    if (num == 0U)
                    {
                        break;
                    }
                }
            }
            if (onlyValidCodePages)
            {
                num &= CodePageDetect.ValidCodePagesMask;
            }
            return(CodePageDetect.GetCodePage(ref num, codePagePriorityList));
        }
        public int GetCodePage(int[] codePagePriorityList, bool onlyValidCodePages)
        {
            uint num = ~this.mask;

            if (onlyValidCodePages)
            {
                num &= CodePageDetect.ValidCodePagesMask;
            }
            return(CodePageDetect.GetCodePage(ref num, codePagePriorityList));
        }
예제 #3
0
        public int GetCodePage(int[] codePagePriorityList, bool onlyValidCodePages)
        {
            var cumulativeMask = ~mask;

            if (onlyValidCodePages)
            {
                cumulativeMask &= CodePageDetect.validCodePagesMask;
            }

            return(CodePageDetect.GetCodePage(ref cumulativeMask, codePagePriorityList));
        }
 internal int[] GetCodePages(int[] codePagePriorityList, FallbackExceptions fallbackExceptions, bool onlyValidCodePages)
 {
     if (codePagePriorityList != null)
     {
         for (int i = 0; i < codePagePriorityList.Length; i++)
         {
             if (!CodePageDetect.IsCodePageDetectable(codePagePriorityList[i], false))
             {
                 throw new ArgumentException(GlobalizationStrings.PriorityListIncludesNonDetectableCodePage, "codePagePriorityList");
             }
         }
     }
     return(this.detector.GetCodePages(codePagePriorityList, fallbackExceptions > FallbackExceptions.None, fallbackExceptions > FallbackExceptions.Common, onlyValidCodePages));
 }
        public int GetWindowsCodePage(int[] codePagePriorityList, bool onlyValidCodePages)
        {
            uint num = ~this.mask;

            num &= 260038656U;
            if (onlyValidCodePages)
            {
                num &= CodePageDetect.ValidCodePagesMask;
            }
            if (num == 0U)
            {
                return(1252);
            }
            return(CodePageDetect.GetCodePage(ref num, codePagePriorityList));
        }
예제 #6
0
        public int GetWindowsCodePage(int[] codePagePriorityList, bool onlyValidCodePages)
        {
            var cumulativeMask = ~mask;


            cumulativeMask &= CodePageDetectData.windowsCodePagesMask;

            if (onlyValidCodePages)
            {
                cumulativeMask &= CodePageDetect.validCodePagesMask;
            }

            if (cumulativeMask == 0)
            {
                return(1252);
            }

            return(CodePageDetect.GetCodePage(ref cumulativeMask, codePagePriorityList));
        }
예제 #7
0
        // Token: 0x06000A74 RID: 2676 RVA: 0x0003E428 File Offset: 0x0003C628
        public int[] GetCodePages(int[] codePagePriorityList, bool allowCommonFallbackExceptions, bool allowAnyFallbackExceptions, bool onlyValidCodePages)
        {
            uint num = uint.MaxValue;

            for (int i = 0; i < this.maskMap.Length; i++)
            {
                if (this.maskMap[i] != 0)
                {
                    uint num2 = CodePageDetectData.codePageMask[i];
                    if (allowAnyFallbackExceptions || (allowCommonFallbackExceptions && (CodePageDetectData.fallbackMask[i] & 1U) != 0U))
                    {
                        num2 |= (CodePageDetectData.fallbackMask[i] & 4294967294U);
                    }
                    num &= num2;
                    if (num == 0U)
                    {
                        break;
                    }
                }
            }
            if (onlyValidCodePages)
            {
                num &= CodePageDetect.ValidCodePagesMask;
            }
            int codePageCount = CodePageDetect.GetCodePageCount(num);

            int[] array = new int[codePageCount];
            int   num3  = 0;

            while (num != 0U)
            {
                array[num3++] = CodePageDetect.GetCodePage(ref num, codePagePriorityList);
            }
            array[num3] = 65001;
            return(array);
        }
 internal static char[] GetCommonExceptionCharacters()
 {
     return(CodePageDetect.GetCommonExceptionCharacters());
 }
 internal static int[] GetDefaultCodePagePriorityList()
 {
     return(CodePageDetect.GetDefaultPriorityList());
 }
 internal static bool IsCodePageDetectable(int cpid, bool onlyValid)
 {
     return(CodePageDetect.IsCodePageDetectable(cpid, onlyValid));
 }