'Split the command using shell-like syntax.'

def split_command(self, command):

    encoded = self.encode_utf8(command)
    try:
        splitted = [s.replace('??', '\\    ') for s in shlex.split(encoded.replace('\\    ', '??'))]
    except ValueError:
        splitted = encoded.split('    ')
    return self.decode_utf8(splitted)
