Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is anybody aware of a way to set the default encoding when saving a file to in SQL Server Management Studio to be ANSI instead of Unicode? Our source control system/diff tools barf when it runs across a Unicode file format.

I've googled a possible solution for this; but all I've found are examples to select the encoding when doing a "Save As..."; which works fine; but needs to be done every time I launch the program.

Is there a registry setting somewhere I could set? Has anybody else run into this and found a solution?

share|improve this question
up vote 6 down vote accepted

This feature has been requested for the past 4 years by dozens of people, however, this still hasn't been implemented that I can see.

share|improve this answer
Thanks; that's what I figured as well. – Jim B Nov 22 '10 at 19:04
It's a 7 year-old feature request as of this comment. Please vote here:… – Caio Proiete Jul 7 '15 at 13:53

I believe it may be possible to do this. I wanted the reverse situation - files always saved in Unicode rather than ANSI - and I found a Registry setting that enabled me to do that. The Registry Key is HKEY_USERS\\Software\Microsoft\Microsoft SQL Server\\Tools\Shell\General and the REG_DWORD value is SaveDocsAsUnicodeInDataLoss which was set to 0. I changed it to 1 and the default encoding when saving files switched from ANSI to Unicode.

I infer from that that setting the value to 0 defaults to ANSI.

To change the setting for any future users, change the value in the HKEY_USERS\.DEFAULT\Software\Microsoft\Microsoft SQL Server\\Tools\Shell\General key.

share|improve this answer
Setting this to 0 does NOT change encoding to ANSI – kmote Oct 27 '15 at 16:34

ANSI is not a good default unless absolutely necessary. UTF-8 is much, much better. UTF-8 is generally compatible with ANSI. (UTF-8 without signature is compatible, and is good. UTF-8 with signature is a non-compatible (and bad) alternative to UTF-8 without signature. The only purpose to add the signature is make it incompatible to ANSI!) But any Unicode format supports international characters, which is normally very good. ANSI has very (very) limited international character support. The world should transition to UTF-8 (without signature). Apparently HTML5 agrees. Horay! Finally a smart character encoding standard.

share|improve this answer
-1 This doesn't answer the question. – Péter Török Jul 19 '12 at 13:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .