comparison runtime/autoload/netrw.vim @ 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 99a0d2fa5921
children f1a387b72cdf
comparison
equal deleted inserted replaced
34106:ab48898659f3 34107:06444c35272b
11585 11585
11586 " --------------------------------------------------------------------- 11586 " ---------------------------------------------------------------------
11587 " netrw#RFC2396: converts %xx into characters {{{2 11587 " netrw#RFC2396: converts %xx into characters {{{2
11588 fun! netrw#RFC2396(fname) 11588 fun! netrw#RFC2396(fname)
11589 " call Dfunc("netrw#RFC2396(fname<".a:fname.">)") 11589 " call Dfunc("netrw#RFC2396(fname<".a:fname.">)")
11590 let fname = escape(substitute(a:fname,'%\(\x\x\)','\=nr2char("0x".submatch(1))','ge')," \t") 11590 let fname = escape(substitute(a:fname,'%\(\x\x\)','\=printf("%c","0x".submatch(1))','ge')," \t")
11591 " call Dret("netrw#RFC2396 ".fname) 11591 " call Dret("netrw#RFC2396 ".fname)
11592 return fname 11592 return fname
11593 endfun 11593 endfun
11594 11594
11595 " --------------------------------------------------------------------- 11595 " ---------------------------------------------------------------------