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

Update applocal.ps1 #4942

Merged
merged 4 commits into from
Jun 13, 2019
Merged

Update applocal.ps1 #4942

merged 4 commits into from
Jun 13, 2019

Conversation

shadowxiali
Copy link
Contributor

Fix #2801 , chinese char path fail

@ras0219-msft
Copy link
Contributor

Thanks for the PR!

I don't totally understand the problem this fixes, and this doesn't currently work on my machine:

D:\src\vcpkg> set-content -path foo.txt -value "" -encoding UTF
Set-Content : Cannot bind parameter 'Encoding'. Cannot convert value "UTF" to type "Microsoft.PowerShell.Commands.FileSystemCmdletProviderEncoding". Error: "The identifier name UTF cannot be processed because it is either too similar or identical to the following enumerator names: UTF8, UTF7, UTF32. Use a more specific identifier name."
At line:1 char:47
+ set-content -path foo.txt -value "" -encoding UTF
+                                               ~~~
    + CategoryInfo          : InvalidArgument: (:) [Set-Content], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.SetContentCommand

The created file in this case is blank regardless of the -encoding setting, so I don't see how this could possibly fix any issue. Is the issue that $copiedFilesLog has chinese characters in the path?

@ras0219-msft ras0219-msft self-assigned this Dec 11, 2018
@shadowxiali
Copy link
Contributor Author

shadowxiali commented Dec 13, 2018

sorry, the correct value is UTF8
PS C:\Users\xiali.000> set-content -path foo.txt -value "" -encoding UTF8
PS C:\Users\xiali.000>

the problem:
create new test_project in path [D:\中文目录]:
test_project.sln file in [D:\中文目录\test_project],
test_project.cpp file in[D:\中文目录\test_project\test_project],
cpp content like

#include <iostream>
#include <boost/filesystem.hpp>

int main()
{
	auto is_dir = boost::filesystem::is_directory("c:\\test");
	std::cout << "c:\\test is directory:" << is_dir << std::endl;
}

, then build, the output window will show fail like:
error MSB3030: 无法复制文件“D:\����Ŀ¼\test_project\Debug\boost_system-vc141-mt-gd-x32-1_68.dll”,原因是找不到该文件。
error MSB3030: 无法复制文件“D:\����Ŀ¼\test_project\Debug\boost_filesystem-vc141-mt-gd-x32-1_68.dll”,原因是找不到该文件。

when modify applocal.ps1 to UTF8, build will success.

Fix microsoft#2801,
prev modify mistake UTF8 to UTF
in win7 chinese path, must utf8 to avoid copy dll fail
@vicroms
Copy link
Member

vicroms commented Mar 6, 2019

Hi @shadowxiali

There are some concerns regarding this change, see comments on #5301.
Explicitly, do you know if these changes introduce Byte Order Marks?

@vicroms vicroms mentioned this pull request Mar 6, 2019
@ras0219-msft ras0219-msft merged commit 555b760 into microsoft:master Jun 13, 2019
@ras0219-msft
Copy link
Contributor

Thanks for this PR!

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.

Can not copy dll files after build
3 participants