microsoft / cppwinrt

C++/WinRT
MIT License
1.64k stars 238 forks source link

Bug: cppwinrt does not support chinese path #1306

Closed HO-COOH closed 1 year ago

HO-COOH commented 1 year ago

Version

2.0.230225.1

Summary

As title suggest

Reproducible example

1. On a chinese version of windows, create a username that has Chinese characters.
2. Create a C++ UWP project, update cppwinrt nuget if necessary.
3. Compile.

Expected behavior

Compiles fine

Actual behavior

已启动生成...
1>------ 已启动生成: 项目: BlankApp1, 配置: Debug x64 ------
1>cppwinrt : error Path 'C:\Users\涓枃鐢ㄦ埛\source\repos\BlankApp1\x64\Debug\Merged\BlankApp1.winmd' is not a file or directory
1>C:\Users\中文用户\source\repos\BlankApp1\packages\Microsoft.Windows.CppWinRT.2.0.230225.1\build\native\Microsoft.Windows.CppWinRT.targets(848,9): error MSB3073: 命令“"C:\Users\中文用户\source\repos\BlankApp1\packages\Microsoft.Windows.CppWinRT.2.0.230225.1\build\native\..\..\bin\"cppwinrt @"x64\Debug\BlankApp1.vcxproj.cppwinrt_comp.rsp"”已退出,代码为 1。
1>已完成生成项目“BlankApp1.vcxproj”的操作 - 失败。
========== 生成: 0 成功,1 失败,0 最新,0 已跳过 ==========
========= 生成 开始于 11:40 AM,并花费了 00.643 秒 ==========

From this log, You can see cppwinrt.exe does not handle the path correctly, while msbuild.exe does

image

Additional comments

Windows 10 1809

Does NOT enable the beta UTF-8 support in language settings, because normal user won't have this enabled.

kennykerr commented 1 year ago

Thanks for reporting! Fix is here: #1307

driver1998 commented 1 year ago

Using UTF-8 codepage manifest won't help OP here though, since it is supported in v1903+.

walbourn commented 1 year ago

Officially Windows 10, Version 1809 (Build 17763) has been out of the support lifecycle for 2-3 years.

https://learn.microsoft.com/en-us/lifecycle/products/windows-10-home-and-pro

https://learn.microsoft.com/en-us/lifecycle/products/windows-10-enterprise-and-education

Windows Server 2019 is Build 17763 so that's really the only currently supported scenario for it. Mainstream support ends in ~7 months.

https://learn.microsoft.com/en-us/lifecycle/products/windows-server-2019

kennykerr commented 1 year ago

Yes, I suggest you upgrade but at least now you have a solution when you do! 😊