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

Should string literals be null terminated? #938

Closed
kennykerr opened this issue May 20, 2022 · 4 comments
Closed

Should string literals be null terminated? #938

kennykerr opened this issue May 20, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request rust Critical for Rust adoption

Comments

@kennykerr
Copy link
Contributor

Original issue here: #937

This could make it easier to work with the ANSI/UTF8 APIs but wouldn't work for the more commonly used wide string APIs.

@kennykerr kennykerr added the enhancement New feature or request label May 20, 2022
@riverar
Copy link
Collaborator

riverar commented May 20, 2022

Would have to carefully handle types such as windows::Win32::UI::Input::KeyboardAndMouse::wszOVERSCORE

@kennykerr
Copy link
Contributor Author

Yes, I'm not sure that's practical without the metadata indicating that certain strings are definitely null terminated or perhaps simply including the null terminator in the string literals for such strings in the win32 metadata. I guess I could transfer this issue to the win32 metadata repo as well. 😁

@riverar
Copy link
Collaborator

riverar commented May 20, 2022

Agreed. Given the disparity of null terminated string constant behavior in the various languages, metadata needs to be a bit more explicit.

@kennykerr kennykerr transferred this issue from microsoft/windows-rs May 20, 2022
@kennykerr kennykerr added the rust Critical for Rust adoption label Sep 2, 2022
@kennykerr
Copy link
Contributor Author

Now that we have string encodings, this doesn't seem to be relevant any longer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request rust Critical for Rust adoption
Projects
None yet
Development

No branches or pull requests

3 participants