(s, encoding="utf-8")
return prefix, command, list(args)
Parse an IRC Message from s

    :param s bytes: bytes to parse
    :param encoding str: encoding to use (Default: utf-8)

    :returns tuple: parsed message in the form of (prefix, command, args)
Parse an IRC Message from s
Parse an IRC Message from s
def parsemsg(s, encoding="utf-8"):
    """Parse an IRC Message from s

    :param s bytes: bytes to parse
    :param encoding str: encoding to use (Default: utf-8)

    :returns tuple: parsed message in the form of (prefix, command, args)
    """

    s = s.decode(encoding, 'replace')

    prefix = u("")
    trailing = []

    if s and s[0] == u(":"):
        prefix, s = s[1:].split(u(" "), 1)

    prefix = parseprefix(prefix)

    if s.find(u(" :")) != -1:
        s, trailing = s.split(u(" :"), 1)
        args = s.split()
        args.append(trailing)
    else:
        args = s.split()

    args = iter(args)
    command = next(args, None)
    command = command and str(command)

    return prefix, command, list(args)
def parsemsg ( s , encoding = "utf-8" ) : s = s . decode ( encoding , 'replace' ) prefix = u ( "" ) trailing = [ ] if s and s [ 0 ] == u ( ":" ) : prefix , s = s [ 1 : ] . split ( u ( " " ) , 1 ) prefix = parseprefix ( prefix ) if s . find ( u ( " :" ) ) != - 1 : s , trailing = s . split ( u ( " :" ) , 1 ) args = s . split ( ) args . append ( trailing ) else : args = s . split ( ) args = iter ( args ) command = next ( args , None ) command = command and str ( command ) return prefix , command , list ( args )