<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _try_char(character, backup, encoding=sys.stdout.encoding):
 """ Return `character` if it can be encoded using sys.stdout, else return the backup character. """

    if character.encode(encoding, 'replace') == b'?':
        return backup
    else:
        return character