I2CE_Template::importHTMLText improperly encodes text

Bug #210623 reported by Mark A. Hershberger
2
Affects Status Importance Assigned to Milestone
I2CE
Fix Released
Undecided
Unassigned

Bug Description

I discovered that "Hôpital" was being sent to the browser in two different ways on the same page. This encoding issue drove me nutters.

In the facility drop-down, this was showing up as "Hôpital". In the report, it would display properly.

After much digging, head-scratching, etc., I found that I2CE_Template::importHTMLText() was using DOMDocument::loadHTML() to get the text into the header of the page.

As the user-contributed notes at http://xrl.us/birp8 (php.net documentation for loadHTML) make clear, loadHTML treats everything as iso-8859-1.

In order to avoid encoding issues, then, loadXML() must be used.

Should probably do the same with loadHTMLFile and make it use DOMDocument::load() instead of DOMDocument::loadHTMLFile()

Changed in i2ce:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.