Skip to main content

repercent_broken_unicode

As per RFC 3987 Section 3.2, step three of converting a URI into an IRI, repercent-encode any octet produced that is not part of a strictly legal UTF-8 octet sequence.

def repercent_broken_unicode(
path: bytes
) - > bytes

As per RFC 3987 Section 3.2, step three of converting a URI into an IRI, repercent-encode any octet produced that is not part of a strictly legal UTF-8 octet sequence.

Parameters

NameTypeDescription
pathbytesThe raw byte sequence representing a URI path that may contain invalid UTF-8 octets.

Returns

TypeDescription
bytesThe processed byte string where invalid UTF-8 sequences have been replaced with their percent-encoded equivalents.