ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 36851] New: - <tar> Task does not support multi-byte file names
Date Wed, 28 Sep 2005 23:00:29 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36851>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36851

           Summary: <tar> Task does not support multi-byte file names
           Product: Ant
           Version: 1.5.4
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: dlr@apache.org


File names which contain multi-byte characters are not handled properly by the
supporting classes of Ant's <tar> Task.  These classes treat characters as
bytes, which is not a valid assumption for non-ASCII characters (e.g. Japanese,
Korean, Chinese, etc.).  This problem was first noticed against the 1.5.4
release, but I've determined that it exists in today's HEAD, and has probably
existed since Stefano/Conor first added this code.


Steps to reproduce:
===================
1. Create a file whose name contains Japanese characters, encoded as UTF-8.
2. Invoke the <tar> task on that file, either programmatically or via a
build.xml file, using the GNU tar long file names extension longfile="gnu".


Observed behavior:
==================
You're greated with the error message:

Problem creating TAR: request to write '125' bytes exceeds size in header of
'104' bytes

Re-running Ant with -verbose/-debug will produce the following stack trace
(using Ant 1.5.4):

--- Nested Exception ---
java.io.IOException: request to write '125' bytes exceeds size in header of
'104' bytes
        at org.apache.tools.tar.TarOutputStream.write(TarOutputStream.java:274)
        at org.apache.tools.tar.TarOutputStream.write(TarOutputStream.java:256)
        at
org.apache.tools.tar.TarOutputStream.putNextEntry(TarOutputStream.java:184)
        at org.apache.tools.ant.taskdefs.Tar.tarFile(Tar.java:410)
        at org.apache.tools.ant.taskdefs.Tar.execute(Tar.java:322)

(I'll attach a patch against HEAD which shows a couple of the problem areas, but
is untested.)


Expected behavior:
==================
As with GNU tar, archiving and unpacking of this data should be handled without
error.


Current work-around:
====================
Fork gtar from Ant.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message