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

Add encoding field to pstring (and cstring?) #16

Open
roblabla opened this issue Feb 27, 2017 · 0 comments
Open

Add encoding field to pstring (and cstring?) #16

roblabla opened this issue Feb 27, 2017 · 0 comments

Comments

@roblabla
Copy link
Contributor

Currently, most protodef implementation assume pstring is utf-8 or ASCII. Fortunately, that's compatible with a lot of protocols. But this is a big shortcoming.

It would be a good idea to allow the protocol author to write what encoding a pstring is in. I wonder if there's a standard about encoding names somewhere ? A quick look gave me https://encoding.spec.whatwg.org/#names-and-labels .

pstring's count argument should count the byte length, regardless of the encoding. I'm fairly sure this is how most protocol send strings.

cstring has a similar problem. We should limit it only to single-byte encodings, given it is meant to be compatible with C char*.

@roblabla roblabla changed the title Add encoding field to pstring (and cstring?) Add encoding field to pstring (and cstring?) Feb 27, 2017
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

1 participant