SSMS and Visual Studio Issue Displaying EUDC (End-User-Defined Characters)

  • Thread starter Thread starter JamesFerebee
  • Start date Start date
J

JamesFerebee

Issue:

----------------------------------------

A customer opened an interesting case stating SQL Server Management Studio (SSMS) would not display EUDC (End-User-Defined Characters) properly. More information on EUDC can be found here: End-User-Defined and Private Use Area Characters.



After testing, it was identified by default, both SQL Server Management Studio and Visual Studio encountered this problem. In contrast, Notepad.exe displayed the desired character as intended. A shared aspect of SSMS and VS is the use of Windows Presentation Foundation (WPF).







Steps to Reproduce the Issue:

----------------------------------------

If you wish to reproduce the problem to see it for yourself:

  1. Run "eudcedit"
  2. In "Select Code" window, select E000 in unicode(Private Use Area, EUDC)
  3. Create a random character, and Edit > Save Character
    • Ex) medium?v=v2&px=400.png
  4. Paste to notepad, where it should show the character you just created
    • medium?v=v2&px=400.png
  5. Paste to SSMS, it does not show the character
    • medium?v=v2&px=400.png







Workaround

----------------------------------------

To workaround this issue for any WPF application, if you pass the FontFamily Class and map it properly, then the character will be displayed. To achieve this is SSMS 19.0, do the following steps. Update the bolded values as needed.

  1. Launch SMSS and go to 'Tools' --> 'Options' --> 'Environment' --> 'Fonts and Colors' and change the font name for 'Text Editor'. Choose a more unique font for ease of finding, such as Lucida Console and press OK.
    1. medium?v=v2&px=400.png
  2. Exit SSMS
  3. Open file "%userprofile%\AppData\Local\Microsoft\SQL Server Management Studio\19.0_IsoShell\Settings\SQL Server Management Studio\NewSettings.vssettings" in your preferred text editor.
  4. Change the corresponding font entry passing the path to the appropriate file. In my testing, there were 9 entries needing updating. The default TTE directory location is C:\Windows\Fonts\EUDC.TTE
    1. Example:
      1. 'FontName="Lucida Console"'
        1. to
      2. 'FontName="Lucida Console,file:///C:\<pathtofile>.TTE#EUDC"'
  5. Relaunch SSMS and test.
  6. Example:
    1. Character:
      1. medium?v=v2&px=400.png

    2. SSMS text editor:
      1. medium?v=v2&px=400.png

    3. Results to text:
      1. medium?v=v2&px=400.png


    4. Results to grid:
      1. medium?v=v2&px=400.png






If you implement this workaround, then make sure to not change the settings in the SSMS User Interface as it'll reset the updated fonts.

The behavior is driven by the Visual Studio Shell, so fixing this term long-term is outside the scope of the SSMS product.

Continue reading...
 
Back
Top