Fixed file reading issues on Windows.

Fixed an issue with reading the settings file on Windows, where Windows
didn't read it as UTF-8 encoded file and displayed wrong special
characters. Improved the code for reading the settings file and the
vocabulary file as well.