def decodeGsm7(encodedText):
    """ GSM-7 text decoding algorithm
    
    Decodes the specified GSM-7-encoded string into a plaintext string.
    
    :param encodedText: the text string to encode
    :type encodedText: bytearray or str
    
    :return: A string containing the decoded text
    :rtype: str
    """
    result = []
    if type(encodedText) == str:
        encodedText = rawStrToByteArray(encodedText) #bytearray(encodedText)
    iterEncoded = iter(encodedText)
    for b in iterEncoded:
        if b == 0x1B: # ESC - switch to extended table
            c = chr(next(iterEncoded))
            for char, value in dictItemsIter(GSM7_EXTENDED):
                if c == value:
                    result.append(char)
                    break
        else:
            result.append(GSM7_BASIC[b])
    return ''.join(result)
def decodeGsm7 ( encodedText ) : result = [ ] if type ( encodedText ) == str : encodedText = rawStrToByteArray ( encodedText ) iterEncoded = iter ( encodedText ) for b in iterEncoded : if b == 0x1B : c = chr ( next ( iterEncoded ) ) for char , value in dictItemsIter ( GSM7_EXTENDED ) : if c == value : result . append ( char ) break else : result . append ( GSM7_BASIC [ b ] ) return '' . join ( result )
GSM-7 text decoding algorithm
    
    Decodes the specified GSM-7-encoded string into a plaintext string.
    
    :param encodedText: the text string to encode
    :type encodedText: bytearray or str
    
    :return: A string containing the decoded text
    :rtype: str