in reply to Re: Problem with file encoding
in thread Problem with file encoding

Especially on Windows, the APIs expect a Wide string instead of UTF-8, while Unixish systems do not care about the encoding and expect a matching byte string. Using the Wide Windows APIs and finding the appropriate encoding on Unixish systems is possible, but for that, we'll have to wait for further information as to what actually goes wrong and what OS the OP is using.