Fix Open File to validate encoding on Windows

I tested this on Binary files as well as:

* UTF-8 with and w/o BOM
* UTF-16 both little and big endian with and without a BOM
* UTF-32 both little and bi g endian with and without a BOM
* ANSI/ASCII