在 2020/8/26 下午5:00, Vincent Torri 写道:
> 
> So, I have a file which has a romanian symbol : Moș.txt
> 
> 1) if I run in MSYS2 ./myprog_gcc (compiled with gcc) Moș.txt, "bad"
> is displayed
> 
> 2) if I run in MSYS2 ./myprog_vs (compiled with VSc) Moș.txt, "good"
> is displayed
> 
> does someone have an idea why there is such difference ?
> 

I suspect this has something to do with the encoding of paths, as `fopen()` 
accepts paths in your system's DBCS encoding
(a.k.a. ANSI code page).

I cannot have your program work in any way on my Windows 7 in Simplified 
Chinese (code page 936). The path passed to
`fopen()` is `Mo?.txt`. That is, the `ș` character which does not exist in 
CP936 gets replaced by a question mark, and is
thus never a valid filename.

It might help if you print the argument passed to `fopen()` and see whether it 
is corrupted or not.


-- 
Best regards,
LH_Mouse

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to