def extract_character(data):
    """ Extract 'character' data from uint8 stored form.

    Parameters
    -----------
    data : ndarray
        Array of uint8 ascii encodings

    Returns
    -------
    extracted : str or ndarray
        Reconstructed ascii string. If the input is a row array, then it will
        be converted to a string. Otherwise, it will be returned as an array of
        'S1' dtype.

    """
    # Matlab stores the transpose of 2D arrays. This must be unapplied here.
    data = data.T
    if data.ndim == 2 and data.shape[0] == 1:
        data = data.tobytes().decode('ascii')
    else:
        data = data.view('S1')
    return data