diff --git a/thirdparty/zip/miniz.h b/thirdparty/zip/miniz.h index 0e269d1..25f525c 100644 --- a/thirdparty/zip/miniz.h +++ b/thirdparty/zip/miniz.h @@ -4045,8 +4045,19 @@ void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h, #if defined(_MSC_VER) static FILE *mz_fopen(const char *pFilename, const char *pMode) { - FILE *pFile = NULL; + FILE *pFile; + const char* tempLocale = setlocale(LC_CTYPE, NULL); + + if (tempLocale) { + setlocale(LC_CTYPE, "en_US.UTF-8"); + } + fopen_s(&pFile, pFilename, pMode); + + if (tempLocale) { + setlocale(LC_CTYPE, tempLocale); + } + return pFile; } static FILE *mz_freopen(const char *pPath, const char *pMode, FILE *pStream) {