wsgidav.util.safe_re_encode#

wsgidav.util.safe_re_encode(s, encoding_to, *, errors='backslashreplace')[source]#

Re-encode str or binary so that is compatible with a given encoding (replacing unsupported chars).

We use ASCII as default, which gives us some output that contains ™ and 香 for every character > 127, for easier debugging. (e.g. if we don’t know the encoding, see #87, #96)