File tree 1 file changed +6
-2
lines changed
src/main/java/org/codehaus/plexus/archiver/zip
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -342,7 +342,7 @@ private void createArchiveMain()
342
342
/**
343
343
* Gets the {@code UnicodeExtraFieldPolicy} to apply.
344
344
*
345
- * @return {@link ZipArchiveOutputStream.UnicodeExtraFieldPolicy.NOT_ENCODEABLE }, if the effective encoding is
345
+ * @return {@link ZipArchiveOutputStream.UnicodeExtraFieldPolicy.NEVER }, if the effective encoding is
346
346
* UTF-8; {@link ZipArchiveOutputStream.UnicodeExtraFieldPolicy.ALWAYS}, if the effective encoding is not
347
347
* UTF-8.
348
348
*
@@ -372,8 +372,12 @@ private ZipArchiveOutputStream.UnicodeExtraFieldPolicy getUnicodeExtraFieldPolic
372
372
}
373
373
}
374
374
375
+ // Using ZipArchiveOutputStream.UnicodeExtraFieldPolicy.NOT_ENCODEABLE as a fallback makes no sense here.
376
+ // If the encoding is UTF-8 and a name is not encodeable using UTF-8, the Info-ZIP Unicode Path extra field
377
+ // is not encodeable as well. If the effective encoding is not UTF-8, we always add the extra field. If it is
378
+ // UTF-8, we never add the extra field.
375
379
return utf8
376
- ? ZipArchiveOutputStream .UnicodeExtraFieldPolicy .NOT_ENCODEABLE
380
+ ? ZipArchiveOutputStream .UnicodeExtraFieldPolicy .NEVER
377
381
: ZipArchiveOutputStream .UnicodeExtraFieldPolicy .ALWAYS ;
378
382
379
383
}
You can’t perform that action at this time.
0 commit comments