Commit b31a5677 authored by Jirka Kosek's avatar Jirka Kosek Committed by Juri Linkov
Browse files

* lisp/international/mule.el (sgml-html-meta-auto-coding-function):

Add support for detecting encoding in HTML5 specified only as
<meta charset="UTF-8">.  Implementation just makes http-equiv and
content-type parts from HTML4 encoding string optional.

Fixes: debbugs:9716
parent 80c6d77f
2011-10-18 Jirka Kosek <jirka@kosek.cz> (tiny change)
* international/mule.el (sgml-html-meta-auto-coding-function):
Add support for detecting encoding in HTML5 specified only as
<meta charset="UTF-8">. Implementation just makes http-equiv and
content-type parts from HTML4 encoding string optional. (Bug#9716)
2011-10-18 Glenn Morris <rgm@gnu.org>
* vc/vc.el (vc-initial-comment): Mark as obsolete. (Bug#9745)
......
......@@ -2403,8 +2403,8 @@ This function is intended to be added to `auto-coding-functions'."
;; (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))
(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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment