icalendar.parser_tools module#

icalendar.parser_tools.data_encode(data, encoding='utf-8')[source]#

Encode all datastructures to the given encoding.

Deprecated since version 7.0.0: Use the private _data_encode() internally. For external use, this function is deprecated. Please contact the maintainers if you rely on this function.

Return type:

bytes | list[bytes] | dict

icalendar.parser_tools.from_unicode(value, encoding='utf-8')[source]#

Converts a value to bytes, even if it is already bytes.

Deprecated since version 7.0.0: Use the private _from_unicode() internally. For external use, this function is deprecated. Please contact the maintainers if you rely on this function.

Return type:

bytes

icalendar.parser_tools.to_unicode(value, encoding='utf-8-sig')[source]#

Converts a value to Unicode, even if it is already a Unicode string.

Deprecated since version 7.0.0: Use the private _to_unicode() internally. For external use, this function is deprecated. Please contact the maintainers if you rely on this function.

Return type:

str