commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grobme...@apache.org
Subject svn commit: r767812 - /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java
Date Thu, 23 Apr 2009 05:55:48 GMT
Author: grobmeier
Date: Thu Apr 23 05:55:48 2009
New Revision: 767812

URL: http://svn.apache.org/viewvc?rev=767812&view=rev
Log:
COMPRESS-63: fields are stored in ASCII

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java?rev=767812&r1=767811&r2=767812&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java
Thu Apr 23 05:55:48 2009
@@ -23,6 +23,7 @@
 import java.io.OutputStream;
 import org.apache.commons.compress.archivers.ArchiveEntry;
 import org.apache.commons.compress.archivers.ArchiveOutputStream;
+import org.apache.commons.compress.utils.ArchiveUtils;
 
 /**
  * The TarOutputStream writes a UNIX tar archive as an OutputStream.
@@ -161,7 +162,7 @@
                 TarArchiveEntry longLinkEntry = new TarArchiveEntry(TarConstants.GNU_LONGLINK,
                                                                     TarConstants.LF_GNUTYPE_LONGNAME);
 
-                final byte[] nameBytes = entry.getName().getBytes(); // TODO is it correct
to use the default charset here?
+                final byte[] nameBytes = ArchiveUtils.toAsciiBytes(entry.getName());
                 longLinkEntry.setSize(nameBytes.length + 1); // +1 for NUL
                 putArchiveEntry(longLinkEntry);
                 write(nameBytes);



Mime
View raw message