Skip to content

Commit

Permalink
Use UTF-8 for filenames in ZIP files per default
Browse files Browse the repository at this point in the history
  • Loading branch information
uroni committed Mar 11, 2017
1 parent 91ce90f commit e72ae3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions miniz_zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -2827,7 +2827,7 @@ mz_bool mz_zip_writer_add_mem_ex_v2(mz_zip_archive *pZip, const char *pArchive_n
if (uncomp_size || (buf_size && !(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)))
bit_flags |= MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR;

if (level_and_flags & MZ_ZIP_FLAG_UTF8_FILENAME)
if (!(level_and_flags & MZ_ZIP_FLAG_ASCII_FILENAME))
bit_flags |= MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8;

if ((int)level_and_flags < 0)
Expand Down Expand Up @@ -3106,7 +3106,7 @@ mz_bool mz_zip_writer_add_cfile(mz_zip_archive *pZip, const char *pArchive_name,
mz_uint8 extra_data[MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE];
mz_zip_internal_state *pState;

if (level_and_flags & MZ_ZIP_FLAG_UTF8_FILENAME)
if (!(level_and_flags & MZ_ZIP_FLAG_ASCII_FILENAME))
gen_flags |= MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8;

if ((int)level_and_flags < 0)
Expand Down
2 changes: 1 addition & 1 deletion miniz_zip.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ typedef enum
MZ_ZIP_FLAG_VALIDATE_HEADERS_ONLY = 0x2000, /* validate the local headers, but don't decompress the entire file and check the crc32 */
MZ_ZIP_FLAG_WRITE_ZIP64 = 0x4000, /* use the zip64 file format, instead of the original zip file format */
MZ_ZIP_FLAG_WRITE_ALLOW_READING = 0x8000,
MZ_ZIP_FLAG_UTF8_FILENAME = 0x10000
MZ_ZIP_FLAG_ASCII_FILENAME = 0x10000
} mz_zip_flags;

typedef enum
Expand Down

0 comments on commit e72ae3f

Please sign in to comment.