Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unicode file names on Windows? #104

Open
plk opened this issue Dec 9, 2020 · 4 comments
Open

Unicode file names on Windows? #104

plk opened this issue Dec 9, 2020 · 4 comments

Comments

@plk
Copy link

plk commented Dec 9, 2020

Using the file appender and a filename such as "пример.log" on Windows results in:

Can't open ??????.log (Invalid argument) at C:\...lib/Log/Log4perl/Appender/File.pm line 151.

It's fine with common Latin1 things but not Cyrillic etc. Is there a way to do this? In the application that uses this, I had to resort to Win32::Unicode::File in other places as this seems to be the only way to read/write files with such glyphs on Windows?

@plk
Copy link
Author

plk commented Dec 10, 2020

I can't see an obvious way to log to a filehandle rather than a file? This would make things possible but there is no Appender for file handles? Log::Dispatch::Handle really only works with IO::Handle objects which are too low level.

@mohawk2
Copy link
Collaborator

mohawk2 commented Feb 10, 2021

Have you taken a look at Log::Dispatch::File? That's available as an "appender" in log4perl. If that doesn't support Win32 unicode files, it should probably be made to do so?

@plk
Copy link
Author

plk commented Feb 11, 2021

I tried that too but no luck - I think whatever the package, it has to use the lower-level "wide" windows APIs or it just wont' work in general.

@mohawk2
Copy link
Collaborator

mohawk2 commented Feb 11, 2021

Yes, it will have to use the right API. If it doesn't do so now, then it can be made to do so via a pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants