* bug#9716: Patch for HTML5 auto-coding support
@ 2011-10-10 15:11 Jirka Kosek
2011-10-17 23:28 ` Juri Linkov
0 siblings, 1 reply; 4+ messages in thread
From: Jirka Kosek @ 2011-10-10 15:11 UTC (permalink / raw)
To: 9716
[-- 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 --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#9716: Patch for HTML5 auto-coding support
2011-10-10 15:11 bug#9716: Patch for HTML5 auto-coding support Jirka Kosek
@ 2011-10-17 23:28 ` Juri Linkov
2011-10-18 1:54 ` Stefan Monnier
0 siblings, 1 reply; 4+ messages in thread
From: Juri Linkov @ 2011-10-17 23:28 UTC (permalink / raw)
To: Jirka Kosek; +Cc: 9716
> 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.
The HTML5 specification says:
Using a meta element with a charset attribute that specifies the encoding
within the first 1024 bytes of the document. E.g. <meta charset="UTF-8">
could be used to specify the UTF-8 encoding. This replaces the need for
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
although that syntax is still allowed.
that confirms that we should install the proposed patch.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#9716: Patch for HTML5 auto-coding support
2011-10-17 23:28 ` Juri Linkov
@ 2011-10-18 1:54 ` Stefan Monnier
2011-10-18 8:03 ` Juri Linkov
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2011-10-18 1:54 UTC (permalink / raw)
To: Juri Linkov; +Cc: Jirka Kosek, 9716
> The HTML5 specification says:
> Using a meta element with a charset attribute that specifies the encoding
> within the first 1024 bytes of the document. E.g. <meta charset="UTF-8">
> could be used to specify the UTF-8 encoding. This replaces the need for
> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
> although that syntax is still allowed.
> that confirms that we should install the proposed patch.
Fine by me,
Stefan
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#9716: Patch for HTML5 auto-coding support
2011-10-18 1:54 ` Stefan Monnier
@ 2011-10-18 8:03 ` Juri Linkov
0 siblings, 0 replies; 4+ messages in thread
From: Juri Linkov @ 2011-10-18 8:03 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Jirka Kosek, 9716-done
>> that confirms that we should install the proposed patch.
>
> Fine by me,
Installed.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-10-18 8:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-10 15:11 bug#9716: Patch for HTML5 auto-coding support Jirka Kosek
2011-10-17 23:28 ` Juri Linkov
2011-10-18 1:54 ` Stefan Monnier
2011-10-18 8:03 ` Juri Linkov
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.