def encode_output(string, errors='replace'):
    # http://ironpython.codeplex.com/workitem/29487
    if sys.platform == 'cli':
        return string
    return string.encode(OUTPUT_ENCODING, errors)
Encodes Unicode to bytes in console encoding.
dataset/ETHPy150Open shellderp/sublime-robot-plugin/lib/robot/utils/encoding.py/encode_output