Byte Order Mark in CFHTTP with UTF-8 interferes with parsing XML, JSON

Description

Originally from https://luceeserver.atlassian.net/browse/LDEV-2400

We are seeing this on all our CFHTTP calls (not just calls receiving text files) since switching from ACF11 to Lucee 5.3.2.77. If the first character of a response is a BOM, the response will fail isJSON() or isXML() unless we pull out the BOM with replace( chr(65279) )

Two reasons to change this behavior:

1) ACF does it - the same CFHTTP call on any ACF engine will not require editing out this character

2) The BOM should be disregarded with UTF-8 anyway:

https://stackoverflow.com/questions/2223882/whats-the-difference-between-utf-8-and-utf-8-without-bom#targetText=On%20the%20meaning%20of%20the,is%20encoded%20in%20UTF%2D8.

Environment

None

Activity

Show:

Details

Assignee

Reporter

Priority

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Created 6 September 2019 at 13:03
Updated 3 August 2021 at 17:55