source: other-projects/trunk/realistic-books/packages/AntInstaller/web/manual1.6.2/manual/OptionalTasks/native2ascii.html@ 19253

Last change on this file since 19253 was 19253, checked in by davidb, 15 years ago

Establishing a source code repository for Veronica's Realistic Book's software

File size: 4.7 KB
Line 
1<html>
2<link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
3 <head><title>Native2Ascii Task</title></head>
4 <body>
5 <h2>Native2Ascii</h2>
6
7 <h3>Description:</h3>
8
9 <p>
10 Converts files from native encodings to ASCII with escaped Unicode.
11 A common usage is to convert source files maintained in a native
12 operating system encoding, to ASCII prior to compilation.
13 </p>
14
15 <p>
16 Files in the directory <em>src</em>
17 are converted from a native encoding to ASCII.
18 By default, all files in the directory are converted.
19 However, conversion may be limited to selected files using
20 <em>includes</em> and <em>excludes</em> attributes.
21 For more information on file matching patterns,
22 see the section on
23 <a href="../dirtasks.html#directorybasedtasks">directory based tasks</a>.
24 If no <em>encoding</em> is specified,
25 the default encoding for the JVM is used.
26 If <em>ext</em> is specified, then output files are renamed
27 to use it as a new extension.
28 More sophisticated file name translations can be achieved using a nested
29 <em>&lt;mapper&gt;</em> element. By default an
30 <a href="../CoreTypes/mapper.html#identity-mapper">identity mapper</a> will be used.
31 If <em>dest</em> and <em>src</em> point to the same directory,
32 the <em>ext</em> attribute or a nested <em>&lt;mapper&gt;</em>
33 is required.
34 </p>
35
36 <p>
37 This task forms an implicit <a href="../CoreTypes/fileset.html">File Set</a>,
38 and supports all attributes of <code>&lt;fileset&gt;</code>
39 (<code>dir</code> becomes <code>src</code>) as well as
40 nested <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code>,
41 and <code>&lt;patternset&gt;</code> elements.
42 </p>
43
44 <table border="1" cellpadding="2" cellspacing="0">
45 <tr>
46 <td><b>Attribute</b></td>
47 <td><b>Description</b></td>
48 <td><b>Required</b></td>
49 </tr>
50 <tr>
51 <td>reverse</td>
52 <td>Reverse the sense of the conversion,
53 i.e. convert from ASCII to native</td>
54 <td align="center">No</td>
55 </tr>
56 <tr>
57 <td>encoding</td>
58 <td>The native encoding the files are in
59 (default is the default encoding for the JVM)</td>
60 <td align="center">No</td>
61 </tr>
62 <tr>
63 <td>src</td>
64 <td>The directory to find files in (default is <em>basedir</em>)</td>
65 <td align="center">No</td>
66 </tr>
67 <tr>
68 <td>dest</td>
69 <td>The directory to output file to</td>
70 <td align="center">Yes</td>
71 </tr>
72 <tr>
73 <td>ext</td>
74 <td>File extension to use in renaming output files</td>
75 <td align="center">No</td>
76 </tr>
77 <tr>
78 <td>defaultexcludes</td>
79 <td>indicates whether default excludes should be used or not
80 (&quot;yes&quot;/&quot;no&quot;).
81 Default excludes are used when omitted.
82 </td>
83 <td align="center">No</td>
84 </tr>
85 <tr>
86 <td>includes</td>
87 <td>comma- or space-separated list of patterns of files that must be
88 included. All files are included when omitted.</td>
89 <td align="center">No</td>
90 </tr>
91 <tr>
92 <td>includesfile</td>
93 <td>the name of a file. Each line of this file is
94 taken to be an include pattern</td>
95 <td align="center">No</td>
96 </tr>
97 <tr>
98 <td>excludes</td>
99 <td>comma- or space-separated list of patterns of files that must be excluded.
100 No files (except default excludes) are excluded when omitted.</td>
101 <td align="center">No</td>
102 </tr>
103 <tr>
104 <td>excludesfile</td>
105 <td>the name of a file. Each line of this file is
106 taken to be an exclude pattern</td>
107 <td align="center">No</td>
108 </tr>
109 </table>
110
111 <h3>Examples</h3>
112
113 <pre>
114&lt;native2ascii encoding=&quot;EUCJIS&quot; src=&quot;srcdir&quot; dest=&quot;srcdir&quot;
115 includes=&quot;**/*.eucjis&quot; ext=&quot;.java&quot;/&gt;
116 </pre>
117
118 <p>
119 Converts all files in the directory <em>srcdir</em>
120 ending in <code>.eucjis</code> from the EUCJIS encoding to ASCII
121 and renames them to end in <code>.java</code>.
122 </p>
123
124<pre>
125&lt;native2ascii encoding=&quot;EUCJIS&quot; src=&quot;native/japanese&quot; dest=&quot;src&quot;
126 includes=&quot;**/*.java&quot;/&gt;
127</pre>
128
129 <p>
130 Converts all the files ending in <code>.java</code>
131 in the directory <em>native/japanese</em> to ASCII,
132 placing the results in the directory <em>src</em>.
133 The names of the files remain the same.
134 </p>
135 </body>
136<hr>
137<p align="center">Copyright &copy; 2000-2002,2004 The Apache Software Foundation. All rights
138Reserved.</p>
139</html>
Note: See TracBrowser for help on using the repository browser.