Encoding when saving scripts

Automate and integrate using the SQL comparison API

Moderator: Chris Auckland

Encoding when saving scripts

Postby AvonWyss » Wed Oct 29, 2008 5:08 pm

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?
AvonWyss
 
Posts: 30
Joined: Wed Oct 29, 2008 4:45 pm

Postby Brian Donahue » Mon Nov 03, 2008 7:37 pm

Hi,

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!
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Postby AvonWyss » Tue Nov 04, 2008 2:21 pm

While googling for answers, I stumbled across some code snippet which had some encoding setting (with a SaveToFile() method or so). I do not have code based on that, however.

So, the question remains, how can I specify the encoding to be used?
AvonWyss
 
Posts: 30
Joined: Wed Oct 29, 2008 4:45 pm

Postby Brian Donahue » Tue Nov 04, 2008 2:41 pm

Hi,

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.
Last edited by Brian Donahue on Tue Nov 04, 2008 2:50 pm, edited 1 time in total.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Postby Brian Donahue » Tue Nov 04, 2008 2:47 pm

Yes, I can confirm that there is no encoding option for synchronizing to script folders and the enhancement request for this issue is in our bug tracking system with an ID of SC-3999. Thanks for pointing it out.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Re:

Postby AvonWyss » Tue Nov 04, 2008 2:53 pm

Brian Donahue wrote: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 found the location again... when using the BlockSaver.SaveToFile() method, the encoding can be specified. Would be nice to have this option everywhere. In fact, I would have expected it in the WriteToFileOptions class... ;)
AvonWyss
 
Posts: 30
Joined: Wed Oct 29, 2008 4:45 pm


Return to SQL Comparison SDK Previous Versions

Who is online

Users browsing this forum: No registered users and 1 guest