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

Serializing strings as C-Style strings (null-terminated) #238

Closed
Waelwindows opened this issue Jun 19, 2018 · 1 comment
Closed

Serializing strings as C-Style strings (null-terminated) #238

Waelwindows opened this issue Jun 19, 2018 · 1 comment

Comments

@Waelwindows
Copy link

@Waelwindows Waelwindows commented Jun 19, 2018

Can you serialize the string "Test" as "Test\00" using bincode?

It doesn't matter which string type it is, but it's preferable to not implement a new string type in rust

@ZoeyR
Copy link
Collaborator

@ZoeyR ZoeyR commented Apr 16, 2020

I don't think this makes sense for bincode. Rust strings are not null terminated and can even contain null bytes. I could see this making sense for cross-language compat if Rust strings couldn't have null bytes, but since they can other languages would need to do processing anyways.

@ZoeyR ZoeyR closed this Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.