in reply to Problem with file encoding

Hello Christian,

The first thing to do would be to check the file name your program is trying to open. It seems that a few bytes are missing from your error output?

If it is the file test\u20ac/edvtest/cdk/kuda_537/TP/TP_chk_mjm.sql, then note that there's an UTF-8-encoded Euro sign (\u20ac) in the path name. I guess that most file systems nowadays handle those paths, but if "from time to time" only happens with files containing non-ASCII charaters, then you might have something to investigate on.

Replies are listed 'Best First'.
Re^2: Problem with file encoding
by Corion (Patriarch) on Mar 28, 2019 at 09:37 UTC

    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.