def encode_to_system(string, errors='replace'):
    return string.encode(SYSTEM_ENCODING, errors)

# workaround for Python 2.5.0 bug: http://bugs.python.org/issue1586513
Encodes Unicode to system encoding (e.g. cli args and env vars).
dataset/ETHPy150Open shellderp/sublime-robot-plugin/lib/robot/utils/encoding.py/encode_to_system