Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text type? #16

Open
coleifer opened this issue Dec 21, 2018 · 5 comments
Open

Text type? #16

coleifer opened this issue Dec 21, 2018 · 5 comments

Comments

@coleifer
Copy link

coleifer commented Dec 21, 2018

I wonder what you think of adding a dedicated text type, which would be identical to the bulk-string, but would indicate UTF8-encoded unicode text as opposed to an arbitrary blob of bytes?

The difference to the client would be equivalent to how Python 3 differentiates str (for unicode) and bytes (for blobs). I think msgpack has something similar.

Or perhaps this is the intended use-case for the "verbatim string" type?

@AngusP
Copy link
Contributor

AngusP commented Jan 2, 2019

I'm a little confused as to the exact use of the verbatim string. I'd assume it is for the same case you're describing, but clarification and perhaps standardisation on an encoding (i.e. UTF-8) would be useful to prevent weird issues. That being said, would it be OK to use non-printing characters (like unicode modifier chars) or terminal colour codes in a verbatim type reply?

@AngusP
Copy link
Contributor

AngusP commented Jan 3, 2019

Perhaps adding a third bin to the verbatim types (existing are mkd for Markdown and txt for text) wto be used for verbatim strings containing things lime images or other blobs, and require that mkd and txt be UTF-8 (or at least printable non-weirdness).

@coleifer
Copy link
Author

coleifer commented Jan 3, 2019

Bulk strings are binary safe, there's no need for that.

@AngusP
Copy link
Contributor

AngusP commented Jan 3, 2019

Verbatim Strings and Bulk Strings would be equivalent in that case but it could be handy having a semantic difference between the two, and leaving verbatim strings still open to arbitrary use (if txt and mkd were constrained to UTF-8 strings)

@coleifer
Copy link
Author

@antirez -- what do you think about a dedicated UTF8-encoded text type? For us Python users this would mean correct handling of str vs bytes, which would be very very nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants