-
Notifications
You must be signed in to change notification settings - Fork 211
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
"setlocale failed" on Windows #1896
Comments
I guess one would need to check UCRT is being used rather than MSVCRT in order for |
How can you figure that out in Windows given a binary? What is the equivalent of the Unix' ldd? |
Yep, either using MSYS2 tools equivalents (ldd/ntldd), or something like https://github.com/lucasg/Dependencies or https://www.dependencywalker.com/ UCRT should be the default since VS 2015 according to MS, but I haven't used it in a very long time, sorry... |
We can use the "dumpbin /dependents avifenc.exe" command. Running that command on a local build I did on 2023-10-27, I get:
Running that command on avifenc.exe I downloaded from AppVeyoer, I get:
|
I got the same |
Yannis: When I run the avifenc.exe downloaded from https://ci.appveyor.com/project/louquillio/libavif/builds/48799163, I am not getting the "setlocale failed" error. I think the problem may be the version of Windows you are using: Windows Server 2016 Datacenter (Google Compute Engine Virtual Machine, Intel Xeon x64) As for the different "dumpbin /dependents avifenc.exe" outputs, I guess it is caused by whether the binary was built using Ninja or Visual Studio. |
Assuming we can trust the info in https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions Windows 10 1903 is version 1903, build 18362. The corresponding server version of Windows is "Windows Server, version 1903". That is newer than Windows Server 2019. So Windows Server 2016 Datacenter is unlikely to support UTF-8 locales, and our I guess we should improve or delete that error message. |
Another option is to detect the runtime Windows version and call |
I looked into detecting the runtime Windows version. It now requires reading registry keys. I think it's not worth the trouble. I suggest we just ignore the return value of the |
I still have the same issue in the same environment. Running Appveyor's avifenc outputs |
The Appveyor log has:
Perhaps a target matching at least Windows 10 1903 (so 10.0.18362 as described above) is needed? |
Yannis: Thank you for verifying the fix. Please test this build instead: https://ci.appveyor.com/project/louquillio/libavif/builds/48905179/artifacts The build you tested was an experimental pull request to revert my fix. So it didn't have the bug fix. |
This binary works, thanks.
Right, I got confused. It is fixed then. |
Apparently the AppVeyor builds at https://ci.appveyor.com/project/louquillio/libavif/history are a mixture of pull requests and commits. Users may unknowingly download a bad "current build" from there if it is built from a pull request. |
Issue
avifenc.exe 1.PNG 1.avif
fails whenavifenc.exe
is downloaded from https://ci.appveyor.com/project/louquillio/libavif/builds/48799163 (built withVisual Studio 2022 Developer Command Prompt v17.8.2
according to the the log and run inVisual Studio 2022 Developer Command Prompt v17.1.0
prompt):Expected behavior
Building and running
avifenc
locally worked, see #1889 (comment) (Visual Studio 2022 Developer Command Prompt v17.1.0
prompt).Environment
Windows Server 2016 Datacenter (Google Compute Engine Virtual Machine, Intel Xeon x64)
The text was updated successfully, but these errors were encountered: