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
[Bug]: fs.readdir
does not work correctly with files that contain umlauts
#42035
Labels
31-x-y
bug 🪲
component/node-integration
has-repro-repo
Issue can be reproduced by cloning a git repo
platform/windows
status/confirmed
A maintainer reproduced the bug or agreed with the feature
Comments
dsanders11
added
31-x-y
has-repro-repo
Issue can be reproduced by cloning a git repo
labels
May 6, 2024
Can't reproduce this locally: nodejs-readdir-test on git:main ❯ e node node.js 1:50PM
Running "/Users/codebytere/Developer/electron-gn/src/out/Testing/Electron.app/Contents/MacOS/Electron node.js"
{ node: '20.12.2' }
[
'äöü.txt'
] |
As far as I understand, it happens only on Windows. |
@oliverschwendener you're right - my bad! reproduced on windows - will investigate further. Interestingly, this doesn't happen in the main process. Running: const { readdir } = require("fs");
const { homedir } = require("os");
const { join } = require("path");
console.log({ node: process.versions.node });
readdir(join(homedir(), "Desktop"), (error, files) => {
if (error) {
console.error(`error: ${error}`);
} else {
console.log(files);
}
}); in
|
codebytere
added
platform/windows
component/node-integration
status/confirmed
A maintainer reproduced the bug or agreed with the feature
labels
May 6, 2024
Interesting. With Electron Fiddle it works as expected, but when I run it with electron (in the main process) it does not work. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
31-x-y
bug 🪲
component/node-integration
has-repro-repo
Issue can be reproduced by cloning a git repo
platform/windows
status/confirmed
A maintainer reproduced the bug or agreed with the feature
Preflight Checklist
Electron Version
31.0.0-alpha.3
What operating system are you using?
Windows
Operating System Version
Windows 11
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
I'm trying to read files from a directory using node's
fs.readdir
function. When there is a file with umlauts in the name, for exampleäöü.txt
it should return'äöü.txt'
.Actual Behavior
When using
fs.readdir
in an electron application it returns'äöü.txt'
. Invoking the same code from node (v20.12.2) works as expected.Testcase Gist URL
https://github.com/oliverschwendener/nodejs-readdir-test
Additional Information
The provided GitHub repo has a guide on how to reproduce the issue.
The text was updated successfully, but these errors were encountered: