def METHOD_NAME(src, itencoding="cp1252"):
    lines = src.split("\n")
    header = lines[0]
    if not header.startswith("# converted from "):
        waspseudoprops = len([line for line in lines if line.startswith("# section:")])
        wasdefines = len(
            [
                line
                for line in lines
                if line.startswith("#filter") or line.startswith("#unfilter")
            ]
        )
    else:
        waspseudoprops = "pseudo-properties" in header
        wasdefines = "#defines" in header
        lines = lines[1:]
    if not (waspseudoprops ^ wasdefines):
        raise ValueError(
            "could not determine file type as pseudo-properties or defines file"
        )
    pf = properties.propfile(personality="mozilla")
    pf.parse("\n".join(lines))
    if wasdefines:
        for line in prop2inc(pf):
            yield line + "\n"
    elif waspseudoprops:
        for line in prop2it(pf):
            yield (line + "\n").encode(itencoding)