From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6a6d1d8878c29fe3,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Received: by 10.68.223.40 with SMTP id qr8mr7397301pbc.0.1342368786304; Sun, 15 Jul 2012 09:13:06 -0700 (PDT) Path: l9ni11880pbj.0!nntp.google.com!news2.google.com!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Those annoying HMTL entities from Google Groups Date: Sun, 15 Jul 2012 17:13:05 +0100 Organization: A noiseless patient Spider Message-ID: Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="9bf283a230abc1bf5b8bf7ae893d3723"; logging-data="10092"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18eiQcqq0Ffmvx8aYLnlz+3+KEDBIu9Fsw=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (darwin) Cancel-Lock: sha1:G97THZerYginv9zP8I2Lbne+6eE= sha1:RmOQKszK96zDRInddJcMTQcKScI= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Date: 2012-07-15T17:13:05+01:00 List-Id: You know how, of late, there have been a lot of HTML entities (for example, ", ', > for ", ', and > respectively) in postings from people who're using Google Groups? Well, I haven't worked out how to translate them while reading, but if you're using Emacs you should be able to translate them while replying using this - probably rubbish - Elisp (which I haven't tidied up): (defun replace-html-entities-region (start end) "Replace “<” by “<”, etc. This works on the current region." (interactive "r") (save-restriction (narrow-to-region start end) (goto-char (point-min)) (while (re-search-forward "&\\([^&;]*\\);" nil t) (let ((e (match-string 1))) (replace-match (replace--entity e) nil nil)) ) ) ) (defun replace--entity (e) (cond ((equal e "amp") "&") ((equal e "apos") "'") ((equal e "gt") ">") ((equal e "lt") "<") ((equal e "quot") "\"") ((equal (substring e 0 1) "#") (char-to-string (string-to-number (substring e 1)))) (t (concat "&" e ";")) ) ) In the reply buffer, C-x h M-x replace-html-entities-region (you may need to do this more than once!)