2
<head><title>Native2Ascii</title></head>
9
Converts files from native encodings to ASCII with escaped Unicode.
10
A common usage is to convert source files maintained in a native
11
operating system encoding, to ASCII prior to compilation.
15
Files in the directory <em>src</em>
16
are converted from a native encoding to ASCII.
17
By default, all files in the directory are converted.
18
However, conversion may be limited to selected files using
19
<em>includes</em> and <em>excludes</em> attributes.
20
For more information on file matching patterns,
22
<a href="index.html../dirtasks.html#directorybasedtasks">directory based tasks</a>.
23
If no <em>encoding</em> is specified,
24
the default encoding for the JVM is used.
25
If <em>ext</em> is specified, then output files are renamed
26
to use it as a new extension.
27
More sophisticated file name translations can be achieved using a nested
28
<em><mapper></em> element. By default an
29
<a href="../CoreTypes/mapper.html#identity-mapper">identity mapper</a> will be used.
30
If <em>dest</em> and <em>src</em> point to the same directory,
31
the <em>ext</em> attribute or a nested <em><mapper></em>
36
This task forms an implicit <a href="index.html../CoreTypes/fileset.html">File Set</a>,
37
and supports all attributes of <code><fileset></code>
38
(<code>dir</code> becomes <code>src</code>) as well as
39
nested <code><include></code>, <code><exclude></code>,
40
and <code><patternset></code> elements.
43
<table border="1" cellpadding="2" cellspacing="0">
45
<td><b>Attribute</b></td>
46
<td><b>Description</b></td>
47
<td><b>Required</b></td>
51
<td>Reverse the sense of the conversion,
52
i.e. convert from ASCII to native</td>
53
<td align="center">No</td>
57
<td>The native encoding the files are in
58
(default is the default encoding for the JVM)</td>
59
<td align="center">No</td>
63
<td>The directory to find files in (default is <em>basedir</em>)</td>
64
<td align="center">No</td>
68
<td>The directory to output file to</td>
69
<td align="center">Yes</td>
73
<td>File extension to use in renaming output files</td>
74
<td align="center">No</td>
77
<td>defaultexcludes</td>
78
<td>indicates whether default excludes should be used or not
79
("yes"/"no").
80
Default excludes are used when omitted.
82
<td align="center">No</td>
86
<td>comma separated list of patterns of files that must be
87
included. All files are included when omitted.</td>
88
<td align="center">No</td>
92
<td>the name of a file. Each line of this file is
93
taken to be an include pattern</td>
94
<td align="center">No</td>
98
<td>comma separated list of patterns of files that must be excluded.
99
No files (except default excludes) are excluded when omitted.</td>
100
<td align="center">No</td>
103
<td>excludesfile</td>
104
<td>the name of a file. Each line of this file is
105
taken to be an exclude pattern</td>
106
<td align="center">No</td>
113
<native2ascii encoding="EUCJIS" src="srcdir" dest="srcdir"
114
includes="**/*.eucjis" ext=".java" />
118
Converts all files in the directory <em>srcdir</em>
119
ending in <code>.eucjis</code> from the EUCJIS encoding to ASCII
120
and renames them to end in <code>.java</code>.
124
<native2ascii encoding='EUCJIS" src="native/japanese" dest="src"
125
includes="**/*.java />
129
Converts all the files ending in <code>.java</code>
130
in the directory <em>native/japanese</em> to ASCII,
131
placing the results in the directory <em>src</em>.
132
The names of the files remain the same.