<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _trychar(char, fallback, asciimode=None):
 # nocover """ Logic from IPython timeit to handle terminals that cant show mu Args: char (str):
 character, typically unicode, to try to use fallback (str):
 ascii character to use if stdout cannot encode char asciimode (bool):
 if True, always use fallback Example: """

    if asciimode is True:
        # If we request ascii mode simply return it
        return fallback
    if hasattr(sys.stdout, 'encoding') and sys.stdout.encoding:  # pragma: nobranch
        try:
            char.encode(sys.stdout.encoding)
        except Exception:  # nocover
            pass
        else:
            return char
    return fallback