Skip to content
This repository has been archived by the owner on Apr 10, 2023. It is now read-only.

Add Text field #110

Closed
rossmacarthur opened this issue Jan 31, 2019 · 0 comments · Fixed by #116
Closed

Add Text field #110

rossmacarthur opened this issue Jan 31, 2019 · 0 comments · Fixed by #116
Labels
feature New feature or request

Comments

@rossmacarthur
Copy link
Owner

It would be nice to have a field that can handle bytes and strings (strings and unicode in Py2). It could take an encoding value as well, otherwise defaulting to UTF-8.

Example:

from serde import Model, fields

class Example(Model):
    text = fields.Text(encoding='utf-8-sig')

assert Example(text=b'test') == Example(text=u'test')
assert Example(text=u'test') == Example(text=u'test')
@rossmacarthur rossmacarthur transferred this issue from rossmacarthur/serde-ext Sep 8, 2019
@rossmacarthur rossmacarthur added the feature New feature or request label Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant