Mercurial > vim
diff src/testdir/test_shortpathname.vim @ 18479:cbea1392c393 v8.1.2234
patch 8.1.2234: get_short_pathname() fails depending on encoding
Commit: https://github.com/vim/vim/commit/3f39697b73f661d6900c7cf5430d967a129660d7
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Oct 30 04:10:06 2019 +0100
patch 8.1.2234: get_short_pathname() fails depending on encoding
Problem: get_short_pathname() fails depending on encoding.
Solution: Use the wide version of the library function. (closes https://github.com/vim/vim/issues/5129)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 30 Oct 2019 04:15:04 +0100 |
parents | 403ac78df9a0 |
children | 26a04a556982 |
line wrap: on
line diff
--- a/src/testdir/test_shortpathname.vim +++ b/src/testdir/test_shortpathname.vim @@ -1,6 +1,9 @@ " Test for shortpathname ':8' extension. " Only for use on Win32 systems! +set encoding=utf-8 +scriptencoding utf-8 + source check.vim CheckMSWindows @@ -67,3 +70,20 @@ func Test_ColonEight() exe "cd " . save_dir endfunc + +func Test_ColonEight_MultiByte() + let dir = 'Xtest' + + let file = dir . '/日本語のファイル.txt' + + call mkdir(dir) + call writefile([], file) + + let sfile = fnamemodify(file, ':8') + + call assert_notequal(file, sfile) + call assert_match('\~', sfile) + + call delete(file) + call delete(dir, 'd') +endfunc