Exemplo n.º 1
0
        /// <summary>
        /// Decodes text from user data in the specified data coding scheme.
        /// </summary>
        /// <param name="userData">The user data to decode. Must contain text according to the specified data coding scheme.</param>
        /// <param name="dataCodingScheme">The data coding scheme specified in the PDU.</param>
        /// <returns>The decoded user data.</returns>
        public static string DecodeText(byte[] userData, byte dataCodingScheme)
        {
            string str;
            byte   alphabet = DataCodingScheme.Decode(dataCodingScheme).Alphabet;
            byte   num      = alphabet;

            switch (num)
            {
            case 0:
            {
                str = PduPartsEx.Decode7BitText(userData);
                break;
            }

            case 1:
            {
                //Label0:
                str = PduPartsEx.Decode7BitText(userData);
                break;
            }

            case 2:
            {
                str = PduPartsEx.DecodeUcs2Text(userData);
                break;
            }

            default:
            {
                //goto Label0;
                str = PduPartsEx.Decode7BitText(userData);
                break;
            }
            }
            return(str);
        }