node icon indicating copy to clipboard operation
node copied to clipboard

fs: fix rmSync to handle non-ASCII characters

Open Yeaseen opened this issue 2 months ago • 3 comments

This is my first pull request here and I read the contribution guide and commit guide.

Update fs.rmSync in src/node_file.cc to properly handle file paths that include non-ASCII characters. This change prevents crashes and errors when attempting to delete files with international or special characters in their names.

Add a test in test/parallel/test-fs-rmSync-special-char.js to ensure that files with non-ASCII characters can be deleted without issues, covering cases that previously led to unexpected behavior or crashes on certain file systems.

Fixes: https://github.com/nodejs/node/issues/56049

For building the node and running the tests, I used:

./configure --ninja
ninja -C out/Release -j 20

make test-only

Yeaseen avatar Dec 03 '24 10:12 Yeaseen