bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#9716: Patch for HTML5 auto-coding support


From: Jirka Kosek
Subject: bug#9716: Patch for HTML5 auto-coding support
Date: Mon, 10 Oct 2011 17:11:48 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.666

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: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]