I have a target to populate a UTF8 supporting MySQL database with a UTF8 encoded .sql file. This works fine.
I have another target populating the same database based on 2 different UTF8 encoded .sql files. This target causes some random Japanese characters to be garbled in the database.
This is the double target:
I have another target populating the same database based on 2 different UTF8 encoded .sql files. This target causes some random Japanese characters to be garbled in the database.
This is the double target:
Code:
<target name="create-db-fire" depends="create-db">
<echo level="info">Inserting Minimal Data ...</echo>
<property name="tmp.script" value="${database.script.dir}/db.sql" />
<!-- copy to a different file to avoid CVS trying to merge -->
<copy file="${database.populate.minimal}" tofile="${tmp.script}" overwrite="yes"> </copy>
<!-- removing commented lines -->
<replaceregexp byline="yes" file="${tmp.script}" match="^.*#.*$" replace=" "> </replaceregexp>
<sql driver="${database.driver}" encoding="UTF-8" password="${database.password}" url="${database.url}" userid="${database.username}" src="${tmp.script}" classpath="${database.driver.jar}"> </sql>
<echo level="info">Inserting Additional Data ...</echo>
<!-- now the additional data -->
<copy file="${database.populate.fire}" tofile="${tmp.script}" overwrite="yes"> </copy>
<!-- removing commented lines -->
<replaceregexp byline="yes" file="${tmp.script}" match="^.*#.*$" replace=" "> </replaceregexp>
<sql driver="${database.driver}" encoding="UTF-8" password="${database.password}" url="${database.url}" userid="${database.username}" src="${tmp.script}" classpath="${database.driver.jar}"> </sql>
<!-- Deleting temporary scripts -->
<delete file="${tmp.script}"> </delete>
</target>
[\code]
Anybody any idea why one file works but populating with 2 files garbles the content?
Thank you.