Focal Point
[CLOSED]HTTP headers

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1447041186

March 07, 2016, 11:18 AM
Wep5622
[CLOSED]HTTP headers
I hand-coded an HTML5 page that depends on being encoded as UTF-8, which works great when I run the plain HTML on the server.

However, as soon as I incorporate it in a fex using -HTMLFORM myStandardsCompliantPage.html, WebFOCUS inserts a Content-Type header that includes a different encoding, which overrides what I put in my HTML head!:
Content-Type:	text/html;charset=iso-8859-1


Both IE(9) and Firefox complain about it and that bugs me a little.

Is there a way to override that from within the fex? Would be neat...

This message has been edited. Last edited by: <Emily McAllister>,


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
March 08, 2016, 10:11 AM
Squatch
Just a guess here, because I've never had to try this before:

document.contentType = "text/html;charset=utf-8";

Put that bit of JavaScript in your window_onload event, like so:

//Begin function window_onload
function window_onload() {


UpdateData();

// TODO: Add your event handler code here
//add onInitialUpdate() function to make changes before initial run of the reports

document.contentType = "text/html;charset=utf-8";
}
//End function window_onload

Hopefully the browser will accept the change.


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
March 08, 2016, 10:14 AM
Squatch
Sorry, the Javascript code is okay but I forgot you are using -HTMLFORM. Just add it as Javascript somewhere in your -HTMLFORM that will execute after the browser loads.


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
March 08, 2016, 10:37 AM
Squatch
Here is some additional information:

contentType/mimeType (IE)


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs