changeset 34107:06444c35272b

runtime(netrw): Decode multibyte percent-encoding filename correctly (#13842) Commit: https://github.com/vim/vim/commit/2357765304e4c55935b5cc853ffb98ae82d64a01 Author: K.Takata <kentkt@csc.jp> Date: Sat Jan 13 01:30:01 2024 +0900 runtime(netrw): Decode multibyte percent-encoding filename correctly (https://github.com/vim/vim/issues/13842) Use `printf("%c")` instead of `nr2char()` to handle '%xx' as a byte. Close #13787 Signed-off-by: Ken Takata <kentkt@csc.jp> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Fri, 12 Jan 2024 17:30:08 +0100
parents ab48898659f3
children 14b69ff2c1ab
files runtime/autoload/netrw.vim
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/autoload/netrw.vim
+++ b/runtime/autoload/netrw.vim
@@ -11587,7 +11587,7 @@ endfun
 "  netrw#RFC2396: converts %xx into characters {{{2
 fun! netrw#RFC2396(fname)
 "  call Dfunc("netrw#RFC2396(fname<".a:fname.">)")
-  let fname = escape(substitute(a:fname,'%\(\x\x\)','\=nr2char("0x".submatch(1))','ge')," \t")
+  let fname = escape(substitute(a:fname,'%\(\x\x\)','\=printf("%c","0x".submatch(1))','ge')," \t")
 "  call Dret("netrw#RFC2396 ".fname)
   return fname
 endfun