Safely return a Unicode string of length one,
    containing the Unicode character with given codepoint.

    :param int codepoint: the codepoint
    :rtype: string

def safe_unichr(codepoint):
    """
    Safely return a Unicode string of length one,
    containing the Unicode character with given codepoint.

    :param int codepoint: the codepoint
    :rtype: string
    """
    if is_py2_narrow_build():
        return ("\\U%08x" % codepoint).decode("unicode-escape")
    elif PY2:
        return unichr(codepoint)
    return chr(codepoint)