@@ -59,7 +59,7 @@ public synchronized void open(Mode mode) throws IOException {
5959 File f = new File (s );
6060 if (f .isFile () && f .canRead ()) {
6161 this .fin = new FileInputStream (f );
62- this .in = new TarArchiveInputStream (codecFactory .getCodec ("gz" ).decode (fin ));
62+ this .in = new TarArchiveInputStream (codecFactory .getCodec ("gz" ).decode (fin ), "UTF-8" );
6363 this .isOpen = true ;
6464 } else {
6565 throw new FileNotFoundException ("check existence or access rights: " + s );
@@ -69,7 +69,7 @@ public synchronized void open(Mode mode) throws IOException {
6969 File f = new File (s );
7070 if (f .isFile () && f .canRead ()) {
7171 this .fin = new FileInputStream (f );
72- this .in = new TarArchiveInputStream (codecFactory .getCodec ("bz2" ).decode (fin ));
72+ this .in = new TarArchiveInputStream (codecFactory .getCodec ("bz2" ).decode (fin ), "UTF-8" );
7373 this .isOpen = true ;
7474 } else {
7575 throw new FileNotFoundException ("check existence or access rights: " + s );
@@ -79,7 +79,7 @@ public synchronized void open(Mode mode) throws IOException {
7979 File f = new File (s );
8080 if (f .isFile () && f .canRead ()) {
8181 this .fin = new FileInputStream (f );
82- this .in = new TarArchiveInputStream (codecFactory .getCodec ("xz" ).decode (fin ));
82+ this .in = new TarArchiveInputStream (codecFactory .getCodec ("xz" ).decode (fin ), "UTF-8" );
8383 this .isOpen = true ;
8484 } else {
8585 throw new FileNotFoundException ("check existence or access rights: " + s );
@@ -89,7 +89,7 @@ public synchronized void open(Mode mode) throws IOException {
8989 File f = new File (s );
9090 if (f .isFile () && f .canRead ()) {
9191 this .fin = new FileInputStream (f );
92- this .in = new TarArchiveInputStream (fin );
92+ this .in = new TarArchiveInputStream (fin , "UTF-8" );
9393 this .isOpen = true ;
9494 } else {
9595 throw new FileNotFoundException ("check existence or access rights: " + s );
@@ -99,22 +99,22 @@ public synchronized void open(Mode mode) throws IOException {
9999 case WRITE :
100100 if (scheme .equals ("targz" )) {
101101 createFileOutputStream (".tar.gz" );
102- this .out = new TarArchiveOutputStream (codecFactory .getCodec ("gz" ).encode (fout ));
102+ this .out = new TarArchiveOutputStream (codecFactory .getCodec ("gz" ).encode (fout ), "UTF-8" );
103103 out .setLongFileMode (TarArchiveOutputStream .LONGFILE_GNU );
104104 this .isOpen = true ;
105105 } else if (scheme .equals ("tarbz2" )) {
106106 createFileOutputStream (".tar.bz2" );
107- this .out = new TarArchiveOutputStream (codecFactory .getCodec ("bz2" ).encode (fout ));
107+ this .out = new TarArchiveOutputStream (codecFactory .getCodec ("bz2" ).encode (fout ), "UTF-8" );
108108 out .setLongFileMode (TarArchiveOutputStream .LONGFILE_GNU );
109109 this .isOpen = true ;
110110 } else if (scheme .equals ("tarxz" )) {
111111 createFileOutputStream (".tar.xz" );
112- this .out = new TarArchiveOutputStream (codecFactory .getCodec ("xz" ).encode (fout ));
112+ this .out = new TarArchiveOutputStream (codecFactory .getCodec ("xz" ).encode (fout ), "UTF-8" );
113113 out .setLongFileMode (TarArchiveOutputStream .LONGFILE_GNU );
114114 this .isOpen = true ;
115115 } else {
116116 createFileOutputStream (".tar" );
117- this .out = new TarArchiveOutputStream (fout );
117+ this .out = new TarArchiveOutputStream (fout , "UTF-8" );
118118 out .setLongFileMode (TarArchiveOutputStream .LONGFILE_GNU );
119119 this .isOpen = true ;
120120 }
0 commit comments