Why Does KM Change Plain Quotes into Smart Quotes?

In a Set Variable to Text Action I've noticed some odd and quite unwanted behaviour as follows: I'm trying to set a variable to a regex pattern for use later in the macro I'm creating. The regex pattern is this:

span class="meta-header">((\d+) images)

I've noticed that when I type the second quote KM changes it to a different character, namely ” as opposed to what I actually typed which is this - ". Which is really annoying as then the regex doesn't work as it should!

Here's a link to a video of me typing that shows this happening.

Dropbox link

I've noticed this happening a lot and it has caused me hours of wasted time trying to figure out why my regexes don't work (the example above is just a simple one!).

I think this is a bug because I can't find a setting anywhere that tells KM to use smart quotes?

Look in your Keyboard Preferences in the Text pane for the smart quotes and dashes checkbox.

@tiffle has discovered the issue, and has requested that we delete his post:

However, I'm going to keep his topic/post because it serves as useful instructions for others who run into this common problem.