You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2013/02/25 03:12:55 UTC

[Bug 54606] New: unable to encode properly to UTF-8 when file.encoding=ANSI_X3.4-1968

https://issues.apache.org/bugzilla/show_bug.cgi?id=54606

            Bug ID: 54606
           Summary: unable to encode properly to UTF-8 when
                    file.encoding=ANSI_X3.4-1968
           Product: Ant
           Version: unspecified
          Hardware: PC
                OS: Mac OS X 10.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
          Assignee: notifications@ant.apache.org
          Reporter: antoine@apache.org
    Classification: Unclassified

Looking at the "Core Trunk (Linux)" build configuration of Ant done on TeamCity
under http://teamcity.jetbrains.com/viewLog.html?buildId=77704 3 tests are
failing.
These tests are core/nested-text-test.xml (testNumericEntities) and
taskdefs/echo-test.xml (testUTF16Encoding and testUTF8Encoding).

testNumericEntities is echoing a string containing the a unlaut followed by the
trademark sign and asserting that the log does indeed contain these signs. The
string is entered as XML entities.

I noticed by looking in detail at the build log that the system property
file.encoding is set in this failing build to ANSI_X3.4-1968 which is a synonym
for ASCII.

The same problem is reproducible on MacOS using JDK 1.7 (build 1.7.0_04-ea-b17
most probably because this JDK 1.7 build also defaults to an ASCII encoding.

Ant did not have this bug back in Ant 1.7.1 and that the bug was introduced in
Ant 1.8.0.

Running the following snipped :
<target name="target2">
<delete file="abc.txt" quiet="true"/>
<echo file="abc.txt" encoding="UTF-8" message="&#xe4;&#169;">
</echo>
</target>
is enough to illustrate the bug. Under Ant 1.7.1 the expected content ä© is
output in "abc.txt"

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54606] unable to encode properly to UTF-8 when file.encoding=ANSI_X3.4-1968

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54606

Antoine Levy-Lambert <an...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|PC                          |Macintosh
            Version|unspecified                 |1.8.0
                 OS|Mac OS X 10.4               |Mac OS X 10.6

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54606] unable to encode properly to UTF-8 when file.encoding=ANSI_X3.4-1968

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54606

Antoine Levy-Lambert <an...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |1.9.0

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54606] unable to encode properly to UTF-8 when file.encoding=ANSI_X3.4-1968

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54606

Antoine Levy-Lambert <an...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from Antoine Levy-Lambert <an...@apache.org> ---
I am looking at ResourceUtils.copyResource as a place where the bug could be.

-- 
You are receiving this mail because:
You are the assignee for the bug.