Script File Encoding is Changed During Synchronisation

Chris HowarthChris Howarth Posts: 8
edited November 5, 2008 2:19PM in SQL Compare Previous Versions
We've hit a problem with SQL Compare 7.1 whereby the encoding of the updated scripts contained in a source folder is changed from UTF-16 to Windows-1252 during the synchronisation process.

We're currently attempting to synchronise our (mostly UTF-16, but some Windows-1252) scripts (held in TFS but checked-out to a folder) with a live database as the two have gradually drifted out of synch. Once the script files have been updated by SQL Compare it is then no longer possible to compare the TFS server version with the workspace version (i.e. the script updated by SQL Compare) as the encoding changes to Windows-1252 during synchronisation.

Is this a bug / feature of SQL Compare? Is there an option that allows the retention of the target scripts' encoding?

Thanks
Chris

Comments

  • Eddie DEddie D Posts: 1,482 Rose Gold 3
    Thank you for your post into the forum.

    The encoding of the SQL Scripts is set via the Tools menu ->Application Options ->Saving SQL Scripts section. There is a drop down box called 'Encoding'. The 4 possible options are:
    UTF-8
    UTF-8 with pre-amble
    Unicode
    ASCII

    Is the database you are synchronizing too using a different collation or case sensitive collations?

    Many Thanks
    Eddie
    Eddie Davis
    Product Support Engineer
    Redgate Software Ltd
    Email: [email protected]
  • Hi Eddie

    Thanks for your response.

    I've previously tried amending the setting that you reference in your reply, but the setting only seems to affect the encoding of the single synchronisation script that SQL Compare generates when the requirement is to synchronise a database with another database or script folder.

    I'm using SQL Compare the other way round, i.e. to update a set of existing scripts as a result of a comparison between a database and folder containing the scripts that I wish to update. The scripts are encoded as UTF-16, yet the encoding of the files is changed to Windows-1252 when SQL Compare has completed synchronisation, regardless of the setting of the 'Saving SQL Scripts -> Encoding' option. Ideally I'd like to retain the encoding of the original scripts.

    Thanks
    Chris
  • Eddie DEddie D Posts: 1,482 Rose Gold 3
    Thank you for your reply.

    Unfortunately we do not have a workaround for this problem.

    Therefore I have added your call details to an existing enhancement request to be able to set the encoding when saving or synchronizing to a scripts folder. The reference for this enhancement request is SC-3999.

    Hopefully this option will appear in the next release of SQL Compare.

    Many Thanks
    Eddie
    Eddie Davis
    Product Support Engineer
    Redgate Software Ltd
    Email: [email protected]
  • Thanks Eddie.

    If possible (from our perspective at least) it would be preferable to retain the original encoding of each individual file (particularly as the encoding could vary between files in the same folder), but I guess that the ability to be able to specify the encoding would also be useful for the scenario where SQL Compare generates a new script for an object that exists in the database but does not exist in the folder.

    Thanks
    Chris
Sign In or Register to comment.