def ensure_unicode(text):
    if isinstance(text, str):
        return text.decode(pyreadline_codepage, "replace")
    return text
helper to ensure that text passed to WriteConsoleW is unicode
dataset/ETHPy150Open deanhiller/databus/webapp/play1.3.x/python/Lib/site-packages/pyreadline/unicode_helper.py/ensure_unicode