Red Gate forums :: View topic - Encoding when saving scripts
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Comparison SDK Previous Versions
SQL Comparison SDK Previous Versions forum

Encoding when saving scripts

Search in SQL Comparison SDK Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
AvonWyss



Joined: 29 Oct 2008
Posts: 30

PostPosted: Wed Oct 29, 2008 5:08 pm    Post subject: Encoding when saving scripts Reply with quote

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?
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6577

PostPosted: Mon Nov 03, 2008 7:37 pm    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
AvonWyss



Joined: 29 Oct 2008
Posts: 30

PostPosted: Tue Nov 04, 2008 2:21 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6577

PostPosted: Tue Nov 04, 2008 2:41 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6577

PostPosted: Tue Nov 04, 2008 2:47 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
AvonWyss



Joined: 29 Oct 2008
Posts: 30

PostPosted: Tue Nov 04, 2008 2:53 pm    Post subject: Re: Reply with quote

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... Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group