Skip to content

unpack should decode string types by default #99

Description

@minrk

msgpack has native text and binary types, but the default behavior of msgpack.unpackb of the text type is to return the still-encoded bytes, rather than the decoded text (unicode on Python 2, str on Python 3). The msgpack spec specifies that strings are utf-8, so it should be a logical default.

Changing the default value for Unpacker.encoding from None to utf-8 would introduce the desired behavior, but it would be problematic for anyone relying on the default behavior. So I thought I would ask before opening a PR. Would a pull request with this change be accepted?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions