When I add title post as: this - is - post
I view code source : this – is – post
How to format code source as: this - is - post
Error: I’m user jQuery UI autocomplete code source ["this – is – post"
,"this – is – post"
, ] and views html autocomplete input is this – is – post
How to fix in jQuery or change echo code source?
WordPress makes number of typographical replacements, related to dashes. You can read through the How WordPress Handles Dashes and Hyphens for full details, but in short your specific case is
[space][hyphen][space]
getting replaced with[space][en-dash][space]
.You will have to step through your code to make sense at which point it goes wrong and turns into visible unwanted entity rather than character.
Depending on how much of this you have the easy fix might be just to type actual en-dash character (Alt+0150 on numpad on Windows) instead of “minus” hyphen.