Skip to content

Conversation

@CarlosNihelton
Copy link
Contributor

Summary of the Pull Request

When storing into the json container the IconPath value directly as a std::string we are subject to unspecified behaviour as Windows stores paths as 16-bit wchar_t , std::string doesn't convey a specific char encoding and the std::filesystem library doesn't mandate a specific conversion.

We need to access the icon path in its native format (which we assume to be std::wstring) and convert it to multibyte.

Details in the linked issue: #13339

PR Checklist

  • Closes: ModernDistro: failed to create Windows Terminal Profile fragment #13339
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Validation Steps Performed

Repeat the process described in the issue #13339 with a build containing the proposed fix.

When storing the IconPath value directly as a string we are subject
to unspecified behaviour as Windows stores paths as 16-bit wchar_t and
std::string doesn't convey a specific char encoding.

To be specific we need to access the icon path in its native format
(which we assume to be std::wstring) and convert it to multibyte.
@OneBlue
Copy link
Collaborator

OneBlue commented Aug 5, 2025

Thank you for doing this @CarlosNihelton! I reproduced the issue, and validated the fix.

@OneBlue
Copy link
Collaborator

OneBlue commented Aug 5, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@OneBlue OneBlue merged commit b89e1f5 into microsoft:master Aug 5, 2025
6 checks passed
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

Successfully merging this pull request may close these issues.

3 participants