(user-id (match-string 2 string))
(entry (assoc key-id epg-user-id-alist)))
(condition-case nil
- (setq user-id (decode-coding-string
- (epg--decode-percent-escape user-id)
- 'utf-8))
+ (setq user-id (epg--decode-percent-escape-as-utf-8 user-id))
(error))
(if entry
(setcdr entry user-id)
(condition-case nil
(if (eq (epg-context-protocol context) 'CMS)
(setq user-id (epg-dn-from-string user-id))
- (setq user-id (decode-coding-string
- (epg--decode-percent-escape user-id)
- 'utf-8)))
+ (setq user-id (epg--decode-percent-escape-as-utf-8 user-id)))
(error))
(if entry
(setcdr entry user-id)
(user-id (match-string 2 string))
(entry (assoc key-id epg-user-id-alist)))
(condition-case nil
- (setq user-id (decode-coding-string
- (epg--decode-percent-escape user-id)
- 'utf-8))
+ (setq user-id (epg--decode-percent-escape-as-utf-8 user-id))
(error))
(if entry
(setcdr entry user-id)
(epg-reset context)))
(defun epg--decode-percent-escape (string)
+ (setq string (string-to-unibyte string))
(let ((index 0))
(while (string-match "%\\(\\(%\\)\\|\\([0-9A-Fa-f][0-9A-Fa-f]\\)\\)"
string index)
(setq string (replace-match "%" t t string)
index (1- (match-end 0)))
(setq string (replace-match
- (string (string-to-number (match-string 3 string) 16))
+ (byte-to-string
+ (string-to-number (match-string 3 string) 16))
t t string)
index (- (match-end 0) 2))))
string))
+(defun epg--decode-percent-escape-as-utf-8 (string)
+ (decode-coding-string (epg--decode-percent-escape string) 'utf-8))
+
(defun epg--decode-hexstring (string)
(let ((index 0))
(while (eq index (string-match "[0-9A-Fa-f][0-9A-Fa-f]" string index))