runtime(netrw): Decode multibyte percent-encoding filename correctly (#13842)

Commit: 
https://github.com/vim/vim/commit/2357765304e4c55935b5cc853ffb98ae82d64a01
Author: K.Takata <[email protected]>
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 <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim
index 3af7ba0f1..bcb1f2475 100644
--- 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'),"     
 ")
+  let fname = 
escape(substitute(a:fname,'%\(\x\x\)','\=printf("%c","0x".submatch(1))','ge')," 
 ")
 "  call Dret("netrw#RFC2396 ".fname)
   return fname
 endfun

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/E1rOKQ4-008fXc-Uj%40256bit.org.

Raspunde prin e-mail lui