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 #5129)
diff --git a/src/testdir/test_shortpathname.vim b/src/testdir/test_shortpathname.vim
index b884820..6b3f85f 100644
--- 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 @@
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