unzip/test/test_version.c \
unzip/test/test_x.c \
unzip/test/test_Z1.c \
- unzip/test/test_P_encryption.c
+ unzip/test/test_P_encryption.c \
+ unzip/test/test_I.c
bsdunzip_test_CPPFLAGS= \
-I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe \
unzip/test/test_encrypted.zip.uu \
unzip/test/test_singlefile.zip.uu \
unzip/test/test_t_bad.zip.uu \
+ unzip/test/test_I.zip.uu \
unzip/test/CMakeLists.txt
--- /dev/null
+/*
+ * Copyright (c) 2023 Aaron Lindros
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+
+/* Test I arg - file name encoding */
+DEFINE_TEST(test_I)
+{
+ const char *reffile = "test_I.zip";
+ int r;
+
+ extract_reference_file(reffile);
+ r = systemf("%s -I UTF-8 %s >test.out 2>test.err", testprog, reffile);
+ assertEqualInt(0, r);
+ assertNonEmptyFile("test.out");
+ assertEmptyFile("test.err");
+
+ assertTextFileContents("Hello, World!\n", "Γειά σου Κόσμε.txt");
+}
--- /dev/null
+begin 644 test_I.zip
+M4$L#!`H```@``&@)AU>$GNBT#@````X````>`!P`SI/.M<ZYSJP@SX/.O\^%
+M(,Z:SXS/@\Z\SK4N='AT550)``,#8G%E"6)Q975X"P`!!.@#```$Z`,``$AE
+M;&QO+"!7;W)L9"$*4$L!`AX#"@``"```:`F'5X2>Z+0.````#@```!X`&```
+M`````````*2!`````,Z3SK7.N<ZL(,^#SK_/A2#.FL^,SX/.O,ZU+G1X=%54
+L!0`#`V)Q975X"P`!!.@#```$Z`,``%!+!08``````0`!`&0```!F````````
+`
+end