GNU bug report logs - #9716
Patch for HTML5 auto-coding support

Previous Next

Package: emacs;

Reported by: Jirka Kosek <jirka <at> kosek.cz>

Date: Mon, 10 Oct 2011 16:12:03 UTC

Severity: normal

Tags: patch

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9716 in the body.
You can then email your comments to 9716 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#9716; Package emacs. (Mon, 10 Oct 2011 16:12:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jirka Kosek <jirka <at> kosek.cz>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 10 Oct 2011 16:12:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jirka Kosek <jirka <at> kosek.cz>
To: bug-gnu-emacs <at> gnu.org
Subject: Patch for HTML5 auto-coding support
Date: Mon, 10 Oct 2011 17:11:48 +0200
[Message part 1 (text/plain, inline)]
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 <at> 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
------------------------------------------------------------------

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9716; Package emacs. (Mon, 17 Oct 2011 23:56:02 GMT) Full text and rfc822 format available.

Message #8 received at 9716 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Jirka Kosek <jirka <at> kosek.cz>
Cc: 9716 <at> debbugs.gnu.org
Subject: Re: bug#9716: Patch for HTML5 auto-coding support
Date: Tue, 18 Oct 2011 02:28:37 +0300
> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9716; Package emacs. (Tue, 18 Oct 2011 01:56:01 GMT) Full text and rfc822 format available.

Message #11 received at 9716 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Juri Linkov <juri <at> jurta.org>
Cc: Jirka Kosek <jirka <at> kosek.cz>, 9716 <at> debbugs.gnu.org
Subject: Re: bug#9716: Patch for HTML5 auto-coding support
Date: Mon, 17 Oct 2011 21:54:34 -0400
> 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




Reply sent to Juri Linkov <juri <at> jurta.org>:
You have taken responsibility. (Tue, 18 Oct 2011 08:05:02 GMT) Full text and rfc822 format available.

Notification sent to Jirka Kosek <jirka <at> kosek.cz>:
bug acknowledged by developer. (Tue, 18 Oct 2011 08:05:02 GMT) Full text and rfc822 format available.

Message #16 received at 9716-done <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Jirka Kosek <jirka <at> kosek.cz>, 9716-done <at> debbugs.gnu.org
Subject: Re: bug#9716: Patch for HTML5 auto-coding support
Date: Tue, 18 Oct 2011 11:03:20 +0300
>> that confirms that we should install the proposed patch.
>
> Fine by me,

Installed.




Message #17 received at 9716-done <at> debbugs.gnu.org (full text, mbox):

From: Jirka Kosek <jirka <at> kosek.cz>
To: Juri Linkov <juri <at> jurta.org>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 9716-done <at> debbugs.gnu.org
Subject: Re: bug#9716: Patch for HTML5 auto-coding support
Date: Tue, 18 Oct 2011 10:21:53 +0200
[Message part 1 (text/plain, inline)]
On 18.10.2011 10:03, Juri Linkov wrote:
>>> that confirms that we should install the proposed patch.
>>
>> Fine by me,
> 
> Installed.

Thanks guys.

			Jirka

-- 
------------------------------------------------------------------
  Jirka Kosek      e-mail: jirka <at> 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
------------------------------------------------------------------

[signature.asc (application/pgp-signature, attachment)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 15 Nov 2011 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 173 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.