UTF-8 encoding for .sql files created or modified in SSMS

Viewed 4248

The default encoding for files saved by my SSMS (v18) is ASCII, not UTF-8. I’ve tried the steps below to set the default encoding to UTF-8 (so that I wouldn’t have to remember to set it every time I create/modify a file), but the default encoding remains ASCII. Outside of SSMS, I can change the encoding in a text editor, but I don’t want to have to do that every time. Have you encountered this issue and, if so, how did you resolve it?

Steps I tried:

  1. From within SSMS, open the “template” file: C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\SqlWorkbenchProjectItems\Sql\SQLFile.sql.
  2. Re-save using correct encoding:
    • File => Save As
    • Click the arrow next to the Save button
    • Choose the relevant encoding: Unicode (UTF-8 with asignature) - Codepage 65001

This is supposed to result in all new query windows having UTF-8 as the default encoding. But, this doesn’t work for me.

0 Answers
Related