Fixed reading and writing files with non-ANSI paths.

Stupid, stupid C++.