wsgidav.compat.to_bytes

wsgidav.compat.to_bytes(s, encoding='utf8')[source]

Convert a text string (unicode) to bytestring (str on Py2 and bytes on Py3).