Cannot create symlink to file with non-latin letters in its name
Describe the issue
ln -s Äfoo.go afoo.go command fails, even though the file named Äfoo.go exists.
Steps to Reproduce the Problem
-
touch Äfoo.go -
ln -s Äfoo.go afoo.go - The command fails with message "no such file or directory"
A symlink should be created instead.
Additional Context: Operating System, Screenshots
- OS: Windows 10 Pro 21H1 with October 2021 cumulative update
It also fails with cyrillic letters in file name, and I suspect it will fail with any non-ASCII letters.
Setting MSYS=winsymlinks:nativestrict is a workaround, no such error is raised then.
There was some commentary (I think on #56) that the code that handles symlinks by copying doesn't use the Unicode APIs.
Okay then, it's good it's known where it should be fixed 🙂
I believe that that's not the correct place, https://github.com/msys2/msys2-runtime/blob/b671a59da80fa1db6115e3275149f9639681453a/winsup/cygwin/path.cc#L2297-L2366 should be the correct one. But I am seeing CopyFile() being called with wide-character strings...
But I am seeing
CopyFile()being called with wide-character strings...
https://github.com/msys2/msys2-runtime/blob/b671a59da80fa1db6115e3275149f9639681453a/winsup/cygwin/path.cc#L2343-L2344
The w_ prefix is a lie. (or maybe it's w for "Windows paths").
The w_ prefix is a lie.
It fooled me!