Skip to content

miniproto.tl.codec.decode_string

decode_string(data: bytes | memoryview, offset: int = 0) -> tuple[str, int]

Decode a UTF-8 TL string.

Parameters:

  • data (bytes | memoryview) – TL wire bytes.
  • offset (int) – Starting byte offset, defaulting to 0.

Returns:

  • tuple[str, int] – Decoded text and first unread offset.