[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: displaying escaped unicode files
From: |
Miles Bader |
Subject: |
Re: displaying escaped unicode files |
Date: |
Thu, 14 Sep 2006 07:29:18 +0900 |
Gulliver7 <rpontisso@yahoo.co.uk> writes:
> http://www.nabble.com/user-files/235986/escapedunicode.properties
> escapedunicode.properties
If you have the previously mentioned `ucs-insert' function (either by
running Emacs 22, or from Dave Love's code for earlier emacs), you can
use a simple function like the following to do the whole buffer:
(defun expand-ucs-escapes ()
(interactive)
(save-excursion
(goto-char (point-min))
(while (re-search-forward "[\\]u\\([0-9a-f][0-9a-f][0-9a-f][0-9a-f]\\)"
nil t)
(let ((code (match-string 1)))
(delete-region (match-beginning 0) (match-end 0))
(ucs-insert code)))))
[Invoke it as "M-x expand-ucs-escapes" or bind it to a key or something.]
-Miles
--
"1971 pickup truck; will trade for guns"