Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

3 Answers

up vote 5 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
add comment

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
add comment

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
3  
-1 This doesn't answer the question. –  Péter Török Jul 19 '12 at 13:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.