| @@ -65,4 +65,50 @@ public class Adapter implements Native2AsciiAdapter { | |||||
| </native2ascii> | </native2ascii> | ||||
| <au:assertLogContains text="adapter called"/> | <au:assertLogContains text="adapter called"/> | ||||
| </target> | </target> | ||||
| <target name="-setup-UTF8-To-ASCII"> | |||||
| <mkdir dir="${input}"/> | |||||
| <mkdir dir="${output}"/> | |||||
| <echo file="${input}/umlauts.properties" encoding="UTF-8">äöü=ÄÖÜ | |||||
| </echo> | |||||
| <echo file="${output}/expected/umlauts.properties" | |||||
| encoding="ASCII">\u00e4\u00f6\u00fc=\u00c4\u00d6\u00dc | |||||
| </echo> | |||||
| </target> | |||||
| <target name="testUTF8-To-ASCII" depends="-setup-UTF8-To-ASCII"> | |||||
| <native2ascii src="${input}" dest="${output}" | |||||
| includes="**/*.properties"/> | |||||
| <au:assertFilesMatch actual="${output}/umlauts.properties" | |||||
| expected="${output}/expected/umlauts.properties"/> | |||||
| </target> | |||||
| <target name="testUTF8-To-ASCII-sun" depends="-setup-UTF8-To-ASCII" | |||||
| description="https://bz.apache.org/bugzilla/show_bug.cgi?id=59855" | |||||
| unless="jdk1.9+"> | |||||
| <native2ascii src="${input}" dest="${output}" implementation="sun" | |||||
| includes="**/*.properties"/> | |||||
| <au:assertFilesMatch actual="${output}/umlauts.properties" | |||||
| expected="${output}/expected/umlauts.properties"/> | |||||
| </target> | |||||
| <target name="-setup-ASCII-To-UTF8"> | |||||
| <mkdir dir="${input}"/> | |||||
| <mkdir dir="${output}"/> | |||||
| <echo file="${input}/umlauts.properties" encoding="ASCII">\u00e4\u00f6\u00fc=\u00c4\u00d6\u00dc | |||||
| </echo> | |||||
| <echo file="${output}/expected/umlauts.properties" | |||||
| encoding="UTF-8">äöü=ÄÖÜ | |||||
| </echo> | |||||
| </target> | |||||
| <target name="testASCII-To-UTF8-sun" depends="-setup-ASCII-To-UTF8" | |||||
| description="https://bz.apache.org/bugzilla/show_bug.cgi?id=59855" | |||||
| unless="jdk1.9+"> | |||||
| <native2ascii src="${input}" dest="${output}" implementation="sun" | |||||
| reverse="true" includes="**/*.properties"/> | |||||
| <au:assertFilesMatch actual="${output}/umlauts.properties" | |||||
| expected="${output}/expected/umlauts.properties"/> | |||||
| </target> | |||||
| </project> | </project> | ||||