[Bug 8598] msvcrt file IO functions do not handle unicode properly in text mode