3

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?

rsreji
  • 170
  • 1
  • 1
  • 17
  • 1
    Could 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 Answers3

5

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:

enter image description here

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:

enter image description here

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • Thank you very much, that helped! – rsreji May 26 '17 at 21:07
  • @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
0

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.

Mike Abusheery
  • 539
  • 2
  • 6
0

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".

jms333
  • 1
  • 1