소스 검색

Throw error if encoding character in utf8 fails

* lisp/org.el (org-link-escape): Throw error if encoding character in
utf8 fails.
David Maus 14 년 전
부모
커밋
0d6dacd978
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      lisp/org.el

+ 4 - 2
lisp/org.el

@@ -8636,8 +8636,10 @@ If optional argument MERGE is set, merge TABLE into
 	       (< char 32) (= char 37) (> char 126))
 	   (mapconcat (lambda (sequence-element)
 			(format "%%%.2X" sequence-element))
-		      (encode-coding-char char 'utf-8) "")
-	   (char-to-string char))) text "")))
+		      (or (encode-coding-char char 'utf-8)
+			  (error "Unable to percent escape character: %s"
+				 (char-to-string char))) "")
+	 (char-to-string char))) text "")))
 
 (defun org-link-unescape (str)
   "Unhex hexified unicode strings as returned from the JavaScript function