From f80f78f2ef473e8ff2802a96d1730e85b2d2a460 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Wed, 6 Nov 2024 12:59:05 -0500 Subject: [PATCH] Reuse StandardCharsets.ISO_8859_1 --- .../compressors/gzip/GzipCompressorOutputStreamTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStreamTest.java b/src/test/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStreamTest.java index 4b3c74dfce6..0dae132d61c 100644 --- a/src/test/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStreamTest.java +++ b/src/test/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStreamTest.java @@ -55,7 +55,7 @@ private void testChineseFileName(final String expected, final String sourceFile, Files.copy(tempSourceFile, gos); } try (GzipCompressorInputStream gis = new GzipCompressorInputStream(Files.newInputStream(targetFile))) { - final byte[] fileNameBytes = gis.getMetaData().getFileName().getBytes(Charset.forName("ISO-8859-1")); + final byte[] fileNameBytes = gis.getMetaData().getFileName().getBytes(StandardCharsets.ISO_8859_1); final String unicodeFileName = new String(fileNameBytes, fileNameCharset); assertEquals(expected, unicodeFileName); }