Search

hi folks,

i am trying to render a symphony page using iso-8895-1 encoding. now, i know, i should use utf-8 and i normally do, but in this case it is really necessary for me to be able to output pages with different encodings.

i have created a page with the following template:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:output method="html"
        doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
        doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
        omit-xml-declaration="yes"
        encoding="iso-8859-1"
        indent="yes" />

    <xsl:template match="data">
        <html>
            <head>
                <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
                <title>test iso-8859-1</title>
            </head>
            <body>abc äöü ?=)(</body>
        </html>
    </xsl:template>

still, when i visit the page the browser renders it set to utf-8 and that's because the page seems to get delivered as such. when i look at the response headers i see:

Content-Type:text/html; charset=utf-8

and obviously that won't work for the characters in the file:

abc ��� ?=)(

any info would be greatly appreciated :)
daniel

These response headers are not set autmatically based on the XSLT processor's output. Instead Symphony has some logic for "standard" Content-Type headers in class.frontendpage.php. If you need something different (and you do, obviously), you can use the Content Type Mappings extension or my Response Header Mappings extension.

thanks michael, i thought it was set by symphony (php) and was actually hoping that there already was an extension to solve this. i will check out your mentions. thanks alot!

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details