mirror of
https://github.com/microsoft/WSL.git
synced 2025-12-10 00:44:55 -06:00
Fix json invalid utf-8 from IconPath (#13340)
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.
This commit is contained in:
parent
8106556cec
commit
b89e1f58c9
@ -2683,7 +2683,7 @@ try
|
||||
|
||||
e["name"] = WideToMultiByte(Configuration.Name);
|
||||
e["guid"] = WideToMultiByte(distributionProfileId);
|
||||
e["icon"] = IconPath.string();
|
||||
e["icon"] = WideToMultiByte(IconPath.native());
|
||||
|
||||
// See https://github.com/microsoft/terminal/pull/18195. Supported in terminal >= 1.23
|
||||
e["pathTranslationStyle"] = "wsl";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user