[Commits] r2726 - core/trunk/geoext/lib/GeoExt/data

commits at geoext.org commits at geoext.org
Tue May 31 09:48:00 CEST 2011


Author: pgiraud
Date: 2011-05-31 09:48:00 +0200 (Tue, 31 May 2011)
New Revision: 2726

Modified:
   core/trunk/geoext/lib/GeoExt/data/PrintProvider.js
Log:
Sending encoding in the request header to prevent issues with encoding in IE, p=me,r=fredj (Closes #424)

Modified: core/trunk/geoext/lib/GeoExt/data/PrintProvider.js
===================================================================
--- core/trunk/geoext/lib/GeoExt/data/PrintProvider.js	2011-05-27 12:04:33 UTC (rev 2725)
+++ core/trunk/geoext/lib/GeoExt/data/PrintProvider.js	2011-05-31 07:48:00 UTC (rev 2726)
@@ -106,6 +106,14 @@
      */
     method: "POST",
 
+    /** api: config[encoding]
+     * ``String`` The encoding to set in the headers when requesting the print
+     * service. Prevent character encoding issues, especially when using IE.
+     * Default is retrieved from document charset or characterSet if existing
+     * or ``UTF-8`` if not.
+     */
+    encoding: document.charset || document.characterSet || "UTF-8",
+
     /** api: config[timeout]
      *  ``Number`` Timeout of the POST Ajax request used for the print request
      *  (in milliseconds). Default of 30 seconds. Has no effect if ``method``
@@ -469,6 +477,7 @@
                 url: this.capabilities.createURL,
                 timeout: this.timeout,
                 jsonData: jsonData,
+                headers: {"Content-Type": "application/json; charset=" + this.encoding},
                 success: function(response) {
                     // In IE, using a Content-disposition: attachment header
                     // may make it hard or impossible to download the pdf due



More information about the Commits mailing list