I tried editing a recent Stack Overflow post with an em-dash in the title. When I tried to fix it, I discovered the post actually contained two hyphen-minus (-) characters in the first place – and that these were being converted to an em-dash (—) character for displaying the question.
It seems that these issues are due to titles using a stripped-down version of Smarty formatting.
This is the same bug reported in Do not replace two hyphens with em dash and Don't change double-hyphens in titles into dashes.
This issue was originally raised back in 2010 and the author’s request to allow “limited Markdown in titles” was declined.
Since this bug continues to crop up, I’d like to propose a simpler (and less ambiguous) solution: Disable the Smarty-like formatting in titles (at least on programming sites such as Stack Overflow).
In the most recent case, the question author clearly intended two hyphen-minus (-) characters to be displayed. If someone actually wants typographic dashes to be displayed, they can compose their question in a good text editor that allows them to explicitly insert UTF-8 characters (FWIW, I use the ItsAllText Firefox extension with Vim as my editor).