Fix #35081: opening .blend files with chinese characters not working. For
compressed files we were not passing the full wide char path to zlib, so not all file names worked. Now we use gzopen_w available in new zlib versions. Patch by Tamito Kajiyama, I added an extra check for the zlib version so it keeps compiling with older versions for now. For platform maintainers: Part of this commit are zlib 1.2.8 libraries for windows 32 bit. We still need update libraries for windows 64 bit and mingw. There's a readme.txt and build.bat included with instructions on how to build.
This commit is contained in:
@@ -247,15 +247,25 @@ void *BLI_gzopen(const char *filename, const char *mode)
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
char short_name[256];
|
||||
|
||||
/* xxx Creates file before transcribing the path */
|
||||
if (mode[0] == 'w')
|
||||
fclose(ufopen(filename, "a"));
|
||||
|
||||
BLI_get_short_name(short_name, filename);
|
||||
/* temporary #if until we update all libraries to 1.2.7
|
||||
* for correct wide char path handling */
|
||||
#if ZLIB_VERNUM >= 0x1270
|
||||
UTF16_ENCODE(filename);
|
||||
|
||||
gzfile = gzopen(short_name, mode);
|
||||
gzfile = gzopen_w(filename_16, mode);
|
||||
|
||||
UTF16_UN_ENCODE(filename);
|
||||
#else
|
||||
{
|
||||
char short_name[256];
|
||||
BLI_get_short_name(short_name, filename);
|
||||
gzfile = gzopen(short_name, mode);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return gzfile;
|
||||
|
||||
Reference in New Issue
Block a user