Sorry, don't know what's causing it. :/ You could try different things to solve it, though. I don't know how this works on Windows, but on Macs, it's possible to switch between different character palettes for your keyboard; so that, for example, using one character palette you can type "åa", but if you use the exact same keystrokes in a different character palette, it produces "ā". So maybe it's something to do with the character palette (or whatever the Windows equivalent is) that you're typing in?
It might also be the program you're working in. Are you working in something other than XSE? If you use a less common scripting program, something in the program might be causing it. And if you are using XSE (or some other program that has never done anything like this before), have you tried using AdvanceText to edit the messed-up dialogue? It's a pain, but it might solve the problem. So, for the script you've got in the image you showed us, you could do a search in AdvanceText for "so sorry! I really" or some other bit of dialogue from the script, save that script to AdvanceText, and then manually go in and delete and re-type all the apostrophes and quotation marks. If you go that way, you probably want to make sure you don't include an apostrophe or quotation mark in the search string (so, don't search for "I'm so sorry!") because if the game thinks that it says "I,'m" instead of "I'm" then it might not recognize the search.
Sorry I can't be more helpful, but it looks like you've been searching for an answer for a while and it doesn't look like anybody else has an answer. I hope that something I said was useful.