Browse Source

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 years ago
parent
commit
0d6dacd978
1 changed files with 4 additions and 2 deletions
  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