From bb3a0099c6909edc779cf9d2eff9656dab9a967e Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 23 Jul 2019 20:56:27 +0200 Subject: os/fs: introduce os_fopen() Windows: Using fopen() directly may need UTF-16 filepath conversion. To achieve that, os_fopen() goes through os_open(). fix #10586 --- test/functional/core/fileio_spec.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/functional/core/fileio_spec.lua') diff --git a/test/functional/core/fileio_spec.lua b/test/functional/core/fileio_spec.lua index c74eb3bb02..e6bce85b8a 100644 --- a/test/functional/core/fileio_spec.lua +++ b/test/functional/core/fileio_spec.lua @@ -22,6 +22,7 @@ describe('fileio', function() os.remove('Xtest_startup_file1') os.remove('Xtest_startup_file1~') os.remove('Xtest_startup_file2') + os.remove('Xtest_тест.md') rmdir('Xtest_startup_swapdir') end) @@ -85,7 +86,22 @@ describe('fileio', function() eq('foobar', foobar_contents); eq('foo', bar_contents); + end) + it('readfile() on multibyte filename #10586', function() + clear() + local text = { + 'line1', + ' ...line2... ', + '', + 'line3!', + 'тест yay тест.', + '', + } + local fname = 'Xtest_тест.md' + funcs.writefile(text, fname, 's') + table.insert(text, '') + eq(text, funcs.readfile(fname, 'b')) end) end) -- cgit