Ensure support for wide-char filenames on Windows #4391

This commit is contained in:
Lovell Fuller
2025-05-13 08:53:37 +01:00
parent 0b5f131df8
commit 7c7f960b60
3 changed files with 22 additions and 1 deletions

View File

@@ -1036,4 +1036,21 @@ describe('Input/output', function () {
});
readable.pipe(inPipeline).pipe(badPipeline);
});
it('supports wide-character filenames', async () => {
const filename = fixtures.path('output.图片.jpg');
const create = {
width: 8,
height: 8,
channels: 3,
background: 'green'
};
await sharp({ create }).toFile(filename);
const { width, height, channels, format } = await sharp(filename).metadata();
assert.strictEqual(width, 8);
assert.strictEqual(height, 8);
assert.strictEqual(channels, 3);
assert.strictEqual(format, 'jpeg');
});
});