Update string handling for file names

I had a crash with the x64 windows build I made on pretty much each fopen. x86 works just fine.
I found out that it actually crashed on filename.toStdString().c_str().
I replaced each of them by filename.toUtf8().constData(). Why? Because there was this one place in the code that didnt crash and used this. I didnt do more research honestly, but this definitly fixes it for me. 

Sorry for all the diffs, my VS removes extra spacing when I save. Just search for fopen to go to actual changes.