mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user