Changeset 17554

Show
Ignore:
Timestamp:
17.10.2008 14:58:46 (11 years ago)
Author:
oranfry
Message:

changes to make the dcff task UTF-8 compatible

Location:
other-projects/trunk/anttasks
Files:
1 added
2 modified

Legend:

Unmodified
Added
Removed
  • other-projects/trunk/anttasks/build.xml

    r17553 r17554  
    4545    <target name="test" depends="test-setup"> 
    4646        <antcall target="test-rsr"/> 
     47        <antcall target="test-dcff"/> 
    4748    </target> 
    4849 
    4950    <target name="test-rsr" depends="test-setup"> 
    5051 
     52        <!-- test 1 --> 
    5153        <copy file="src/test/rsr.txt" tofile="test/rsr1.txt"/> 
    52         <copy file="src/test/rsr.txt" tofile="test/rsr2.txt"/> 
    53         <copy file="src/test/rsr.txt" tofile="test/rsr3.txt"/> 
    54         <copy file="src/test/rsr.txt" tofile="test/rsr4.txt"/> 
    55  
    5654        <rsr file="test/rsr1.txt" pattern="things" replacement="strings"/> 
    5755 
     56        <!-- test 2 --> 
     57        <copy file="src/test/rsr.txt" tofile="test/rsr2.txt"/> 
    5858        <rsr file="test/rsr2.txt"> 
    5959            <job pattern="things" replacement="objects"/> 
     
    6161        </rsr> 
    6262 
     63        <!-- test 3 --> 
     64        <copy file="src/test/rsr.txt" tofile="test/rsr3.txt"/> 
    6365        <rsr file="test/rsr3.txt" pattern="@path@" replacement="C:\Program Files\Greenstone 2.80"/> 
    6466        <rsr file="test/rsr3.txt" pattern="@path-with-winpath@" replacement="C:\Program Files\Greenstone 2.80" winPath="true"/> 
    6567 
     68        <!-- test 4 --> 
     69        <copy file="src/test/rsr.txt" tofile="test/rsr4.txt"/> 
    6670        <rsr file="test/rsr4.txt"> 
    6771            <job pattern="@path@" replacement="C:\Program Files\Greenstone 2.80"/> 
     
    7175    </target> 
    7276 
     77    <target name="test-dcff" depends="test-setup"> 
     78 
     79        <!-- test 1 --> 
     80        <copy file="src/test/dcff.txt" tofile="test/dcff1.txt"/> 
     81        <dcff file="test/dcff1.txt" startTag="The" endTag="brown" leaveTags="true"/> 
     82 
     83        <!-- test 2 --> 
     84        <copy file="src/test/dcff.txt" tofile="test/dcff2.txt"/> 
     85        <dcff file="test/dcff2.txt" startTag="quick" endTag="brown"/> 
     86 
     87        <!-- test 3 --> 
     88        <copy file="src/test/dcff.txt" tofile="test/dcff3.txt"/> 
     89        <dcff file="test/dcff3.txt" startTag="fox" leaveTags="true"/> 
     90 
     91    </target> 
     92 
     93 
    7394    <target name="test-clean"> 
    7495        <delete dir="test"/> 
  • other-projects/trunk/anttasks/src/org/greenstone/anttasks/DeleteChunkFromFile.java

    r17295 r17554  
    7474 
    7575            //writer to temp file 
    76             out = new BufferedWriter(new FileWriter(temp)); 
     76            out = new BufferedWriter( new OutputStreamWriter(new FileOutputStream(temp), "UTF8") ); 
    7777 
    7878        } catch (IOException e) { 
     
    8484        BufferedReader in = null; 
    8585        try { 
    86             in = new BufferedReader( new FileReader( file ) ); 
     86            in = new BufferedReader( new InputStreamReader(new FileInputStream(file), "UTF8") ); 
    8787        } catch ( Exception e ) { 
    8888            throw new BuildException( "Error - Couldn't open the specified file" );