Please be aware that this is a long standing problem. Byte ordering is needed for utf-16 and 32, and there is a byteordering code for that at the start of the file. For utf-8 byte ordering is not required, however the utf-8 standard is a little vague as to whether it is not allowed. .... this means that some people allow it and some do not. Microsoft uses the BOM to indicate that a text file is encoded as UTF-8 rather then the current default platform encoding. Sun does not allow the BOM and it's UTF-8 reader converts it into a ?. This is what the ant sql task sees. At one stage during the development of java 1.6, the UTF-8 reader was changed to ignore the BOM code, but this was reverted as it caused some backward comparability problems.
Note that nearly all XML parsers in java do not use the sun UTF-8 reader, and handle the (pointless) BOM code correctly. Peter On Thu, Jun 18, 2009 at 11:53 PM, Michael Ludwig<mil...@gmx.de> wrote: > China Creatxr schrieb am 16.06.2009 um 14:27:37 (+0000): >> Does anyone find the way to run the utf-8 formated SQL scripts which >> with BOMs by Ant now? Thanks. > > The <sql> task has an @encoding attribute. Set sql/@encoding = 'UTF-8' > and see if that helps, which it should do. > > Michael Ludwig > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@ant.apache.org > For additional commands, e-mail: user-h...@ant.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org