After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 728436 - [PATCH] Write meta charset tag instead of meta http-equiv content-type
[PATCH] Write meta charset tag instead of meta http-equiv content-type
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: general
git master
Other Mac OS
: Normal enhancement
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2014-04-17 16:33 UTC by Hiroaki Nakamura
Modified: 2021-07-05 13:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The patch file, an example program and an example html file. (1.07 KB, application/x-gzip)
2014-04-17 16:33 UTC, Hiroaki Nakamura
Details

Description Hiroaki Nakamura 2014-04-17 16:33:56 UTC
Created attachment 274621 [details]
The patch file, an example program and an example html file.

I made a patch for writing HTML files with a meta charset tag instead of meta http-equiv content-type tag.
Attachment contains the patch for libxml2-2.9.1, an example program to read and write a HTML file, and an example input html file.

Without this patch, if you read a html with a meta charset tag and save it, you got both meta http-equiv tag and meta charset tag.

Input example1.html
---
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>HTML5 example</title>
</head>
<body>
<h1>HTML5 save example</h1>
<p>I would like to meta charset tag is used instead of meta http-equiv.</p>
</body>
</html>
---

Output example1-out.html WITHOUT this patch.
---
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>HTML5 example</title>
</head>
<body>
<h1>HTML5 save example</h1>
<p>I would like to meta charset tag is used instead of meta http-equiv.</p>
</body>
</html>
---

Output example1-out.html WITH this patch.
---
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>HTML5 example</title>
</head>
<body>
<h1>HTML5 save example</h1>
<p>I would like to meta charset tag is used instead of meta http-equiv.</p>
</body>
</html>
---

Could you review this patch and merge it?
Thanks.
Comment 1 Hiroaki Nakamura 2014-04-17 16:36:18 UTC
Ah, I didn't know I don't need to escape less-than sign '<'.
Please read example with replacing &lt; with <.
Thanks.
Comment 2 GNOME Infrastructure Team 2021-07-05 13:21:34 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/libxml2/-/issues/

Thank you for your understanding and your help.