patch 7.4.1917
Problem: History lines read from viminfo in different encoding than when
writing are not converted.
Solution: Convert the history lines.
diff --git a/src/testdir/test_viminfo.vim b/src/testdir/test_viminfo.vim
index 279b1c3..1fefba1 100644
--- a/src/testdir/test_viminfo.vim
+++ b/src/testdir/test_viminfo.vim
@@ -179,3 +179,25 @@
call delete('Xviminfo')
endfunc
+
+func Test_viminfo_encoding()
+ if !has('multi_byte')
+ return
+ endif
+ set enc=latin1
+ call histdel(':')
+ call histadd(':', "echo '\xe9'")
+ wviminfo Xviminfo
+
+ set fencs=utf-8,latin1
+ set enc=utf-8
+ sp Xviminfo
+ call assert_equal('latin1', &fenc)
+ close
+
+ call histdel(':')
+ rviminfo Xviminfo
+ call assert_equal("echo 'é'", histget(':', -1))
+
+ call delete('Xviminfo')
+endfunc