in reply to Re^5: Character encoding in console in Windows
in thread Character encoding in console in Windows

it would still fail to open the file.

Correct. You'd need to encode using the current ANSI code page (Windows) or current locale encoding (unix).

In Windows, you could also use the system's wide character interface (CreateFileW) via some means other than open. Win32API::File's CreateFileW function would be one such mean.

Replies are listed 'Best First'.
Re^7: Character encoding in console in Windows
by elef (Friar) on Sep 18, 2010 at 08:16 UTC
    Indeed you are right, I just tested it. If I encode the script in ANSI (which on my computer means Latin-2) - and remove the use UTF-8 line, of course - then it works. Not much of a general solution as other people will have different encodings on their Windows machines, but it's at least some limited functionality for some situations.