While saving .sql files from SQL Server Management Studio in to my local windows folder, it looks to be including some binary characters making AccuRev comparisons impossible. I looked for possible save options and couldn't locate any. and couldn't find any. Any suggestions please?
-
1Could it be that those files are stored in **UTF-8** and have the UTF-8 Byte-Order Mark ("BOM", 3 bytes at the beginning of the file)?? If so: can you tell AccuRev to ignore/interpret those files as UTF-8? – marc_s May 06 '17 at 13:56
-
Thanks for the quick response. Yes, I see a weird character in the beginning of the file in AccuRev. I tried performing a keep operation in AccuRev and asked it to consider it as a text file. That doesn't seem to help either. Not sure if I'm missing something here. – rsreji May 06 '17 at 13:59
-
The only options I see in AccuRev v6.2.2 are text, ptext & binary. – rsreji May 06 '17 at 14:06
3 Answers
If you can't tell AccuRev to handle this as UTF-8 files (this sucks - these days, all software should really know about UTF-8 and handle it correctly!), then you might need to do something in SQL Server Management Studio instead.
When you have a SQL statement open and you click on "File > Save", in the "Save" dialog, there is a little down-arrow to the right of the Save button:
If you click that (instead of just clicking on the button itself), you can select "Save with Encoding", which allows you to pick what encoding to use for your files - pick something like the Windows-1252 Western European - that should not have any UTF-8 Byte-Order Mark bytes at the start:

- 732,580
- 175
- 1,330
- 1,459
-
-
@rsreji: if this answer helped you solve your problem, then please [**accept this answer**](http://meta.stackoverflow.com/q/5234/153998). This will show your appreciation for the people who *spent their own time to help you*. – marc_s May 26 '17 at 21:07
AccuRev does handle UTF-8 character encoding. However, older versions may not have that capability.
Make sure that the file is being saved using UTF-8. Anything else will have binary content and should be typed as such.

- 539
- 2
- 6
When you export sql files from MS SQL Server Management Studio in unicode (by default), it puts a "FF FE BOM" at the front of the file which forces programs to treat it as binary. Exporting as ANSI solved it. Choose "Save as ANSI Text".

- 1
- 1