public int GetCodePageCoverage(int codePage)
        {
            Charset charset = Charset.GetCharset(codePage);

            if (charset.UnicodeCoverage == CodePageUnicodeCoverage.Complete)
            {
                return(100);
            }
            if (!charset.IsDetectable)
            {
                if (charset.DetectableCodePageWithEquivalentCoverage == 0)
                {
                    throw new ArgumentException("codePage is not detectable");
                }
                codePage = charset.DetectableCodePageWithEquivalentCoverage;
            }
            return(this.detector.GetCodePageCoverage(codePage));
        }
Ejemplo n.º 2
0
        public static Encoding GetEncoding(int codePage)
        {
            Charset charset = Charset.GetCharset(codePage);

            return(charset.GetEncoding());
        }
Ejemplo n.º 3
0
        public static Encoding GetEncoding(string name)
        {
            Charset charset = Charset.GetCharset(name);

            return(charset.GetEncoding());
        }
Ejemplo n.º 4
0
        public static Charset GetCharset(Encoding encoding)
        {
            int num = CodePageMap.GetCodePage(encoding);

            return(Charset.GetCharset(num));
        }