emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master d57bb0c: Treat passed strings as raw-text when percent-escaping i


From: Robert Pluim
Subject: master d57bb0c: Treat passed strings as raw-text when percent-escaping in epg
Date: Thu, 12 Dec 2019 02:37:38 -0500 (EST)

branch: master
commit d57bb0c323c326518d9cc974dc794f9e23a51917
Author: Robert Pluim <address@hidden>
Commit: Robert Pluim <address@hidden>

    Treat passed strings as raw-text when percent-escaping in epg
    
    The strings contained in gpg keys can contain UTF-8 data, but can also
    use percent-escapes to encode non-ASCII chars.  When converting those
    escapes, use 'raw-text' coding system rather than 'string-to-unibyte',
    since the latter signals an error for non-ASCII characters.
    
    * lisp/epg.el (epg--decode-percent-escape): Convert the passed
    string to raw-text before treating percent escapes (Bug#38512).
---
 lisp/epg.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/epg.el b/lisp/epg.el
index 090317f..5466716 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -2032,7 +2032,7 @@ If you are unsure, use synchronous version of this 
function
     (epg-reset context)))
 
 (defun epg--decode-percent-escape (string)
-  (setq string (string-to-unibyte string))
+  (setq string (encode-coding-string string 'raw-text))
   (let ((index 0))
     (while (string-match "%\\(\\(%\\)\\|\\([[:xdigit:]][[:xdigit:]]\\)\\)"
                         string index)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]