예제 #1
0
        static Asda2EncodingHelper()
        {
            for (int index = 0; index < 256; ++index)
            {
                Asda2EncodingHelper.RuCharacters[index] = (char)index;
            }
            for (int index = 0; index < Asda2EncodingHelper.RuEncode.Length; ++index)
            {
                Asda2EncodingHelper.RuCharacters[(int)Asda2EncodingHelper.RuEncode[index]] =
                    Asda2EncodingHelper.RuChars[index];
            }
            for (int index = 0; index < Asda2EncodingHelper.RuCharactersReversed.Length; ++index)
            {
                if (index >= 256)
                {
                    Asda2EncodingHelper.RuCharactersReversed[index]         = (byte)63;
                    Asda2EncodingHelper.RuCharactersReversedTranslit[index] = (byte)63;
                    Asda2EncodingHelper.ForReverseTranslit[index]           = '?';
                }
                else
                {
                    Asda2EncodingHelper.RuCharactersReversed[index]         = (byte)index;
                    Asda2EncodingHelper.RuCharactersReversedTranslit[index] = (byte)index;
                    Asda2EncodingHelper.ForReverseTranslit[index]           = (char)index;
                }
            }

            for (int index = 0; index < Asda2EncodingHelper.RuChars.Length; ++index)
            {
                Asda2EncodingHelper.RuCharactersReversed[(int)Asda2EncodingHelper.RuChars[index]] =
                    Asda2EncodingHelper.RuEncode[index];
                Asda2EncodingHelper.RuCharactersReversedTranslit[(int)Asda2EncodingHelper.RuChars[index]] =
                    Asda2EncodingHelper.RuEncodeTranslit[index];
            }

            for (int index = 0; index < Asda2EncodingHelper.EngTranslitChars.Length; ++index)
            {
                Asda2EncodingHelper.ForReverseTranslit[(int)Asda2EncodingHelper.EngTranslitChars[index]] =
                    Asda2EncodingHelper.RuChars[index];
            }
            Asda2EncodingHelper.InitAllowedEnglishSymbols();
        }