This can especially happen when you are moving the site to a different server or when you are cloning a site. In those processes, your site database needs to be exported and imported. Due to different formats of storing characters in the database, sometimes you may encounter a problem with strange characters (like —) appearing in your WordPress posts.

There are several ready solutions for this problem that you can find here.