On 2025-01-25 Lasse Collin wrote: > On 2025-01-25 Pali Rohár wrote: > > Also what could be different is that _findfirst may be affected by > > setlocale function as IIRC UCRT supports changing process locale but > > only for UCRT functions. > > > > Another important thing is that FindFirstFile is affected by the > > AreFileApisANSI() function. Some info is in SetFileApisToOEM() spec: > > https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-setfileapistooem > > > > I wonder how much this matters. If Win9x compatibility isn't needed, > the new dirent code would only use wide character functions > (_wfindfirst or FindFirstFileW). If I understand correctly, the > functions you mentioned won't affect the wide character APIs.
Even if wide char functions were always used to read filenames, perhaps AreFileApisANSI() needs to be taken into account in readdir() to determine if the wide char names should be converted to CP_ACP or CP_OEMCP? WideCharToMultiByte() also has CP_THREAD_ACP on W2k and later. The docs of SetFileApisToOEM() and AreFileApisANSI() say that they are about the process code page, not thread. Maybe CP_ACP is correct then. I haven't tested. -- Lasse Collin _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public