<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def encode_gen(line, encoding="utf-8"):
 """Encodes all Unicode strings in line to encoding Parameters line: Iterable of Unicode strings \tDate to be encoded encoding: String, defaults to "utf-8" \tTarget encoding """


    for ele in line:
        if isinstance(ele, types.UnicodeType):
            yield ele.encode(encoding)
        else:
            yield ele