Cannot handle file names with special characters properly
Amazingkenneth opened this issue · 5 comments
Under the same compilation environment, files with character Σ
in the file name automatically created by Competitive Companion cannot be compiled and tested properly.
Pop-up error message: Could not launch testcase process. Is 'g++' in your PATH?
The prob file .cph/.C_Σ.cpp_dff3a7f9af8ab0b10eadb767a68213c6.prob
{"name":"C - Σ","group":"AtCoder - UNIQUE VISION Programming Contest 2024 Spring(AtCoder Beginner Contest 346)","url":"https://atcoder.jp/contests/abc346/tasks/abc346_c","interactive":false,"memoryLimit":1024,"timeLimit":2000,"tests":[{"input":"4 5\n1 6 3 1\n","output":"11\n","id":1711195657300},{"input":"1 3\n346\n","output":"6\n","id":1711195657232},{"id":1711195657231,"input":"10 158260522\n877914575 24979445 623690081 262703497 24979445 1822804784 1430302156 1161735902 923078537 1189330739","output":"12523196466007058"}],"testType":"single","input":{"type":"stdin"},"output":{"type":"stdout"},"languages":{"java":{"mainClass":"Main","taskClass":"C"}},"batch":{"id":"abf60f90-8b57-4e1d-9daa-9aef40879756","size":1},"srcPath":"d:\\contest\\C_Σ.cpp"}
![Successful running testcases](https://private-user-images.githubusercontent.com/81886982/316243831-35ffbb1d-8b50-4ce2-8b62-beb02253036d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA2NzgxODcsIm5iZiI6MTcyMDY3Nzg4NywicGF0aCI6Ii84MTg4Njk4Mi8zMTYyNDM4MzEtMzVmZmJiMWQtOGI1MC00Y2UyLThiNjItYmViMDIyNTMwMzZkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzExVDA2MDQ0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThiMGY4Y2U4NjllNjQ2YTFkMjVhMTZiOTI5YjljNzBhYWY1Mjc5ZmRhYjcxOTU5NDQ3MzM5OTkzMTMxYjYzZDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.OmvhMOnjSyz5n4nE_fNJNZfvoMYP5T7SWcvXKWpO9JA)
![Cannot handle the filename](https://private-user-images.githubusercontent.com/81886982/316243862-6918048b-888c-4e4f-96a4-571d4c7d0320.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA2NzgxODcsIm5iZiI6MTcyMDY3Nzg4NywicGF0aCI6Ii84MTg4Njk4Mi8zMTYyNDM4NjItNjkxODA0OGItODg4Yy00ZTRmLTk2YTQtNTcxZDRjN2QwMzIwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzExVDA2MDQ0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg4MGRjYmYyMDI1NTNiNTA2YmJjNzAyYjE0NDg5NmI0MGRhNDIxOThmYWVhOTUzNTFlYWZmOGM4MTAxNjNjNDYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.p197A4LOvLzUlOeV0Z-ediiCOyxtmfsXucjooljM3pA)
Extension Version: v6.1.0
VS Code Version: 1.87.2
Browser Version: Microsoft Edge - Version 122.0.2365.92 (Official build) (64-bit)
Operating System: Microsoft Windows 11 Home 10.0.22631
I met the error when compiling using the mingw compiler in the package manager Scoop. The bin
directory D:\Scoop\apps\mingw\current\bin
has been added to the system environment variables.
Executables and Library files found in the directory:
PS D:\Scoop\apps\mingw\current\bin> ls
Directory: D:\Scoop\apps\mingw\current\bin
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 2023-10-17 3:16 1178112 addr2line.exe
-a---- 2023-10-17 3:16 1205248 ar.exe
-a---- 2023-10-17 3:16 1817600 as.exe
-a---- 2023-10-17 6:07 2618880 c++.exe
-a---- 2023-10-17 3:16 1175552 c++filt.exe
-a---- 2023-10-17 6:07 2616832 cpp.exe
-a---- 2023-10-17 3:16 1234432 dlltool.exe
-a---- 2023-10-17 3:16 75776 dllwrap.exe
-a---- 2023-10-17 3:16 2499584 dwp.exe
-a---- 2023-10-17 3:16 63488 elfedit.exe
-a---- 2023-10-17 6:07 2618880 g++.exe
-a---- 2023-10-17 6:07 61952 gcc-ar.exe
-a---- 2023-10-17 6:07 61952 gcc-nm.exe
-a---- 2023-10-17 6:07 61952 gcc-ranlib.exe
-a---- 2023-10-17 6:07 2615296 gcc.exe
-a---- 2023-10-17 6:07 1863168 gcov-dump.exe
-a---- 2023-10-17 6:07 1861632 gcov-tool.exe
-a---- 2023-10-17 6:07 2040320 gcov.exe
-a---- 2023-10-17 7:23 4587 gdb-add-index
-a---- 2023-10-17 7:23 59684 gdb.exe
-a---- 2023-10-17 7:23 9945600 gdborig.exe
-a---- 2023-10-17 7:23 400896 gdbserver.exe
-a---- 2023-10-17 6:09 60416 gendef.exe
-a---- 2023-10-17 6:09 74240 genidl.exe
-a---- 2023-10-17 6:09 31232 genpeimg.exe
-a---- 2023-10-17 6:07 2617856 gfortran.exe
-a---- 2023-10-17 3:16 1242112 gprof.exe
-a---- 2023-10-17 3:16 1746944 ld.bfd.exe
-a---- 2023-10-17 3:16 1746944 ld.exe
-a---- 2023-10-17 3:16 4756480 ld.gold.exe
-a---- 2023-10-17 6:08 32768 libatomic-1.dll
-a---- 2023-10-17 6:08 111616 libgcc_s_seh-1.dll
-a---- 2023-10-17 6:08 3118080 libgfortran-5.dll
-a---- 2023-10-17 6:08 280576 libgomp-1.dll
-a---- 2023-10-17 6:08 362496 libquadmath-0.dll
-a---- 2023-10-17 6:08 2246144 libstdc++-6.dll
-a---- 2023-10-17 6:08 54784 libwinpthread-1.dll
-a---- 2023-10-17 6:07 32673280 lto-dump.exe
-a---- 2023-10-17 7:24 270336 make.exe
-a---- 2023-10-17 7:24 270336 mingw32-make.exe
-a---- 2023-10-17 3:16 1194496 nm.exe
-a---- 2023-10-17 3:16 1312256 objcopy.exe
-a---- 2023-10-17 3:16 2415104 objdump.exe
-a---- 2023-10-17 3:16 1205248 ranlib.exe
-a---- 2023-10-17 3:16 1002496 readelf.exe
-a---- 2023-10-17 3:16 1178112 size.exe
-a---- 2023-10-17 3:16 1182208 strings.exe
-a---- 2023-10-17 3:16 1312256 strip.exe
-a---- 2023-10-17 6:10 530432 widl.exe
-a---- 2023-10-17 3:16 1200640 windmc.exe
-a---- 2023-10-17 3:16 1290752 windres.exe
-a---- 2023-10-17 6:07 2618880 x86_64-w64-mingw32-c++.exe
-a---- 2023-10-17 6:07 2618880 x86_64-w64-mingw32-g++.exe
-a---- 2023-10-17 6:07 2615296 x86_64-w64-mingw32-gcc-13.2.0.exe
-a---- 2023-10-17 6:07 61952 x86_64-w64-mingw32-gcc-ar.exe
-a---- 2023-10-17 6:07 61952 x86_64-w64-mingw32-gcc-nm.exe
-a---- 2023-10-17 6:07 61952 x86_64-w64-mingw32-gcc-ranlib.exe
-a---- 2023-10-17 6:07 2615296 x86_64-w64-mingw32-gcc.exe
-a---- 2023-10-17 6:07 2617856 x86_64-w64-mingw32-gfortran.exe
PS D:\Scoop\apps\mingw\current\bin>
I have seen this issue happening very rarely ,when clicking run option more than one time consecutively.
Is it still reproducible on your side ??
Yes, but the error is only on the faulty file, and the other files compile normally.
Solution:
The issue was resolved by setting the system locale to UTF-8, which allows the linker (ld.exe
) to properly handle non-ASCII characters in file names.
Steps to Set System Locale to UTF-8 on Windows:
- Open the Control Panel.
- Go to "Region" and then the "Administrative" tab.
- Click "Change system locale..."
- Modify "Current system locale" to a character set that contains the character (for example, I chose Simplified Chinese) and uncheck "Beta: Use Unicode UTF-8 for worldwide language support".
- Restart your computer.
After setting the system locale to UTF-8, the compilation and testing of files with non-ASCII characters in their names work correctly.