Encoding when saving scripts
AvonWyss
Posts: 35
I cannot find any place to specify the encoding to be used when scripts are being created through ScriptSynchronizationActions. In fact, I believe such an option does not exist at all in the current version (7.1).
The files are apparently saved as UTF8 without BOM. However, we would like to have the BOM added since some tools (including our soure control diff tool) recognize the file as being ANSI instead of UTF8, which has lead to problems. Strange enough, it almost seems that this was in V5.x and has been dropped?
The files are apparently saved as UTF8 without BOM. However, we would like to have the BOM added since some tools (including our soure control diff tool) recognize the file as being ANSI instead of UTF8, which has lead to problems. Strange enough, it almost seems that this was in V5.x and has been dropped?
Comments
Sorry it's taken so long to get back to you, but we have been digging into previous documentation for SQL Comparison SDK and cannot find any method for setting encoding in any previous version, either. Since Synchronize to scripts had been introduced as a new feature in version 6 of the API, that left checking version 6 help, and the ScriptSynchronizationAction(s) classes don't seem to have any option for setting the script encoding that we can find.
If you could provide a code sample on how you set the text encoding in the previous version of the API, I'd be happy to look into whether the option has changed or been moved somewhere else.
Thanks!
So, the question remains, how can I specify the encoding to be used?
There aren't any encoding option on the SaveToFolder method, although there are some encoding options available for saving a single SQL migration script. I'm probably right in assuming that when synchronizing to a scripts folder, it's more important that the correct SQL collation is used rather than the text encoding.
I will double-check on this and if it's needed, log a feature request for it based on the fact that the text encoding may be interfering with source control operation.