From: Jirka Kosek <jirka@kosek.cz>
To: 9716@debbugs.gnu.org
Subject: bug#9716: Patch for HTML5 auto-coding support
Date: Mon, 10 Oct 2011 17:11:48 +0200 [thread overview]
Message-ID: <4E930B34.1040000@kosek.cz> (raw)
[-- Attachment #1: Type: text/plain, Size: 2042 bytes --]
Hi,
please find attached patch that
* added support for detecting encoding in HTML5 specified only as <meta
charset=***>
Implementation just makes http-equiv and content-type parts from HTML4
encoding string optional.
Thanks,
Jirka
*** mule.el.orig/mule.el Sun May 2 21:50:16 2010
--- mule.el Mon Oct 10 17:03:16 2011
*************** This function is intended to be added to
*** 2358,2365 ****
;; (allowing for whitespace at bob). Note: 'DOCTYPE NETSCAPE' is
;; useful for Mozilla bookmark files.
(when (and (re-search-forward
"\\`[[:space:]\n]*\\(<!doctype[[:space:]\n]+\\(html\\|netscape\\)\\|<html\\)"
size t)
! (re-search-forward
"<meta\\s-+http-equiv=[\"']?content-type[\"']?\\s-+content=[\"']text/\\sw+;\\s-*charset=\\(.+?\\)[\"']"
size t))
! (let* ((match (match-string 1))
(sym (intern (downcase match))))
(if (coding-system-p sym)
sym
--- 2358,2366 ----
;; (allowing for whitespace at bob). Note: 'DOCTYPE NETSCAPE' is
;; useful for Mozilla bookmark files.
(when (and (re-search-forward
"\\`[[:space:]\n]*\\(<!doctype[[:space:]\n]+\\(html\\|netscape\\)\\|<html\\)"
size t)
! (re-search-forward
"<meta\\s-+\\(http-equiv=[\"']?content-type[\"']?\\s-+content=[\"']text/\\sw+;\\s-*\\)?charset=[\"']?\\(.+?\\)[\"'\\s-/>]"
size t))
!
! (let* ((match (match-string 2))
(sym (intern (downcase match))))
(if (coding-system-p sym)
sym
--
------------------------------------------------------------------
Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
------------------------------------------------------------------
Professional XML consulting and training services
DocBook customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
------------------------------------------------------------------
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]
next reply other threads:[~2011-10-10 15:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-10 15:11 Jirka Kosek [this message]
2011-10-17 23:28 ` bug#9716: Patch for HTML5 auto-coding support Juri Linkov
2011-10-18 1:54 ` Stefan Monnier
2011-10-18 8:03 ` Juri Linkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E930B34.1040000@kosek.cz \
--to=jirka@kosek.cz \
--cc=9716@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).