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

Document in the C++ stdin/stdout host that it's UTF-8 #3

Closed
jonwis opened this issue Jun 7, 2023 · 1 comment
Closed

Document in the C++ stdin/stdout host that it's UTF-8 #3

jonwis opened this issue Jun 7, 2023 · 1 comment

Comments

@jonwis
Copy link
Owner

jonwis commented Jun 7, 2023

The C++ process pipeline handler (the side that creates the child process) properly converts its written content to UTF-8 (via winrt::to_string) but it hands a std::string back to the caller from the output. The docs on that should say "this is a UTF-8 string smuggled in a std::string" ... There is no C++ standard support for UTF-8, but winrt::to_hstring(std::string_view) exists and does the right thing now. microsoft/cppwinrt#269 (comment)

To do:

  • Document that the process pipe thinks in UTF-8 and the std::string is UTF-8 null terminated
  • Show an example of converting from std::string to std::wstring for use with normal string operations

To consider: should there be a specific new type that is "I am a smuggled UTF-8 string" so you have to do something with it before operating on it unless the dev knows what they're doing?

@jonwis
Copy link
Owner Author

jonwis commented Jun 8, 2023

Fixed

@jonwis jonwis closed this as completed Jun 8, 2023
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