"Write to Text File" does not add BOM to existing file

Hi,

as part of our build we script we use Microsoft’s “SQL Server Data Tools” to generate an SQL script for schema differences in our software versions. This generated file is encoded as UTF8 but without a Byte Order Mark.
We also use Finalbuilder’s “Write to Text File” action to manipulate this file. In the action we have set the encoding to UTF8 and checked the box for “Write Byte Order Mark”. The BOM is never added to the file though and this has recently been causing us trouble because we now have some non-ASCII text in our SQL scripts.
Is the action’s behaviour intentional? If so is there some other way we can get FB to write the BOM to the file?

btw
Finalbuilder’s built in help for the command seems to be somewhat outdated because it does not even mention Encodings and the screenshot does not show those settings either.

Regards,
Christoph

Hi Chillefeld,

I have tested the “Write to text file” action this morning and found that its behaving as expected. The BOM comes into affect when the file is being created or when no encoding has been set on a file to be appended to.

I assume that your updating files that already have an encoding and this would be the reason the BOM is not being added. In this case I would suggest copying the contents of the original file into a variable and creating a new file with the BOM required.

Thank you for pointing out the help not fully explaining this. It is something we are endeavouring to improve.

Thanks for the reply. I will modify the build script as you suggested.