'Optional charset of SEARCH command'

def opt_charset(self, line):

    if (line[:7].upper() == 'CHARSET'):
        arg = line.split('    ', 2)
        if (len(arg) == 1):
            raise IllegalClientResponse('Missing    charset    identifier')
        if (len(arg) == 2):
            arg.append('')
        (spam, arg, rest) = arg
        return (arg, rest)
    else:
        return (None, line)
