diff --git a/src/read.rs b/src/read.rs index 7dc60a61a..3f770bf99 100644 --- a/src/read.rs +++ b/src/read.rs @@ -1793,4 +1793,20 @@ mod test { let mut reader = ZipArchive::new(Cursor::new(v)).unwrap(); reader.by_name("七个房间.txt").unwrap(); } + + #[test] + fn test_utf8() { + let mut v = Vec::new(); + v.extend_from_slice(include_bytes!("../tests/data/linux-7z.zip")); + let mut reader = ZipArchive::new(Cursor::new(v)).unwrap(); + reader.by_name("你好.txt").unwrap(); + } + + #[test] + fn test_utf8_2() { + let mut v = Vec::new(); + v.extend_from_slice(include_bytes!("../tests/data/windows-7zip.zip")); + let mut reader = ZipArchive::new(Cursor::new(v)).unwrap(); + reader.by_name("你好.txt").unwrap(); + } } diff --git a/tests/data/linux-7z.zip b/tests/data/linux-7z.zip new file mode 100644 index 000000000..26f5de5be Binary files /dev/null and b/tests/data/linux-7z.zip differ diff --git a/tests/data/windows-7zip.zip b/tests/data/windows-7zip.zip new file mode 100644 index 000000000..982b21a67 Binary files /dev/null and b/tests/data/windows-7zip.zip differ