Skip to content

Encoding/Decoding bytestrings with libserialize #15683

Closed
@aochagavia

Description

@aochagavia

Some encoding protocols don't enforce UTF8 in strings. In this cases, it would be useful to provide functions to encode/decode a string as an array of bytes (maybe something like read_bytestring and emit_bytestring).

An example of this situation is the bencode protocol. Currently, the only way to decode a struct containig a byte string is to implement a special trait called FromBencode.

Another use case for this is to (de)serialize XML (see this subreddit thread)

Should I submit a PR to add this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions