Skip to content

string.encode_wtf8, string.encode_wtf16 should return encoded length #24

@wingo

Description

@wingo

Currently string.encode_wtf8 and string.encode_wtf16 return nothing, effectively relying on the user to have computed a length via string.measure_wtf8 or string.measure_wtf16 beforehand. But they might as well return the encoded length; it's a value that's ready at hand, and there are some cases where you might reserve an ample buffer for encoding but you don't know how many bytes will be written.

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