You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

native2ascii.html 4.6 KiB

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