def uri_escape_match(match):
    """
    Converts a Match object representing a single character
    into an ntriple escape sequence.
    """
    code = ord(match.group())
    if code <= 65535:
        return '\\u%04x' % code
    else:
        return '\\U%08x' % code
