Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] emacs conversion of HTML Entities
- Date: Wed, 14 Apr 2004 20:01:41 +0900
- From: "Stephen J. Turnbull" <stephen@example.com>
- Subject: Re: [tlug] emacs conversion of HTML Entities
- References: <5.1.1.8.2.20040414141551.00d37fd0@example.com>
- Organization: The XEmacs Project
- User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Portable Code, linux)
;; use with the wrong emacs is an exercise for the reader; unicode ;; handling is not yet standardized ;; there oughtta be a way to do this in PSGML but I can't find it, ;; maybe I'll send this one to Lennart. (progn (unless (featurep 'xemacs) (error "ooh yuck you've got the wrong Emacs!")) (cond ((emacs-version>= 21 5 7) (message "You have been living right!")) ((emacs-version>= 21 4) (message "The impossible just takes a few more lines.") (require 'un-define) (defalias 'unicode-to-char 'ucs-to-char)) (t (error "This XEmacs was released before you were born. Upgrade!"))) (defun entities-to-characters () (interactive) (goto-char (point-min)) (while (re-search-forward "&#\\([a-fA-F0-9]+\\);" nil t) (message (match-string 1)) (insert (or (unicode-to-char (string-to-number (match-string 1) 16)) (match-string 0))) ; fail-safe (delete-region (match-beginning 0) (match-end 0))))) ;; Caveats: I think your entity syntax is wrong and the numbers you give ;; don't make any sense (U+0333 is a combining character, so it won't be ;; in the Japanese repertoire). But it works for me with E00; and ;; with &#FFFE;. -- Institute of Policy and Planning Sciences http://turnbull.sk.tsukuba.ac.jp University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN Ask not how you can "do" free software business; ask what your business can "do for" free software.
- Follow-Ups:
- Re: [tlug] emacs conversion of HTML Entities
- From: Josh Glover
- References:
- [tlug] emacs conversion of HTML Entities
- From: David Riggs
Home | Main Index | Thread Index
- Prev by Date: [tlug] emacs conversion of HTML Entities
- Next by Date: Re: [tlug] giving up on email
- Previous by thread: [tlug] emacs conversion of HTML Entities
- Next by thread: Re: [tlug] emacs conversion of HTML Entities
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links