amisoft
Posts: 3
|
| Posted: 07/26/2007, 4:37 PM |
|
Hi,
I have a problem with Templace encoding.
My main page 'index.ccp' has an HTML file who encoding is utf-8.
In Page_AfterInitialize, I would change my Template file by another one :
global $TemplateFileName;
$TemplateFileName = 'newfile.html'
newfile.html have another encoding : ISO-8859.1 and my page does not display, codecharge send ISO-8859-1 character with an header and meta charset set to utf-8..
In index.php, I see a variable $TemplateEncoding who apparently contains the original charset : utf-8.
So in Page_AfterInitialize, I add :
global $TemplateEncoding;
$TemplateEncoding = 'iso-8859-1';
By the problem was already here because in index.php, there is a line later :
$Tpl->LoadTemplate(PathToCurrentPage . $TemplateFileName, $BlockToParse, "UTF-8", "replace");
and in this line, the original encoding is hard-coded (generated when I publish my project): "UTF-8".
How can I change this hardcoded value ?
To summarize : I want to keep my project with encoding 'utf-8' and change template file on the fly whith a different encoding (without manualy modified index.php every time I rebuild my project).
Eric.
P.S. Sorry for my poor english, I'm french.
|