It works fine now, just in case someone else runs into similar trouble this
is what I've done.

1. set the encoding for the PHPTAL object
2. Added <?xml version="1.0" encoding="ISO-8859-1"?>
3. Added <meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1"/>

Setting 1 isn't necessary with 2 or 3.
Also noticed that I didn't need both 2 and 3, as long as I had one of them
it worked.

Would be great if someone with some encoding know-how could educate me on
the proper way of doing this :-)

Cheers,
 micke

2009/1/3 Mikael Andersson <mail.mi...@gmail.com>

> Think I figured something out.
> The value isn't displayed when it contains Swedish characters like åäö .
>
> I just tried $template->setEncoding('ISO-8859-1') but that didn't make a
> difference.
>
> Do you know what I'm missing?
>
> Thanks,
>  Micke
>
>
>
> 2009/1/3 Mikael Andersson <mail.mi...@gmail.com>
>
> Hi
>>
>> Your example works perfectly fine.
>>
>> But I fail to see how it differs from mine, which I still can't get to
>> work properly.
>>
>> Thanks,
>>  micke
>>
>> 2009/1/3 Levi Stanley <l...@eneservices.com>
>>
>>  Try this:
>>>
>>> ]] $ more test.php
>>>
>>> <?php
>>>
>>> include_once('PHPTAL.php');
>>>
>>> $template = new PHPTAL('test.xml');
>>> $template->set('userInfo', 'Default userInfo info');
>>>
>>> try {
>>>     print $template->execute();
>>> } catch(Exception $e){
>>>     print "Error:: {$e->getMessage()}\n";
>>> }
>>>
>>> ?>
>>>
>>>
>>> ]] $ more test.xml
>>>
>>> <div id="userInfo" class="userInfo" tal:content="userInfo"
>>> tal:condition="exists:userInfo">
>>>     User information message
>>> </div>
>>>
>>> Mikael Andersson wrote:
>>>
>>> Hi
>>>
>>> I just ran into something which I'm not sure if I'm doing something
>>> wrong, there is a bug or if it is the way it is suppose to work.
>>>
>>> == This works:
>>> Controller content:
>>> $template->userinfo = 'Default userInfo info';
>>>
>>> Template content:
>>>         <div id="userInfo" class="userInfo" tal:content="userinfo"
>>> tal:condition="exists:userinfo">
>>>               User information message
>>>         </div>
>>>
>>> == And this doesn't work:
>>> Controller content:
>>> $template->userInfo = 'Default userInfo info';
>>>
>>> Template content:
>>>         <div id="userInfo" class="userInfo" tal:content="userInfo"
>>> tal:condition="exists:userInfo">
>>>               User information message
>>>         </div>
>>>
>>>
>>> The only difference is the case of the "userInfo" property.
>>>
>>> Note that the div always gets rendered, just not its content.
>>>
>>> Cheers,
>>>  Micke
>>>
>>> ------------------------------
>>>
>>> _______________________________________________
>>> PHPTAL mailing 
>>> listphp...@lists.motion-twin.comhttp://lists.motion-twin.com/mailman/listinfo/phptal
>>>
>>>
>>>
>>> _______________________________________________
>>> PHPTAL mailing list
>>> PHPTAL@lists.motion-twin.com
>>> http://lists.motion-twin.com/mailman/listinfo/phptal
>>>
>>>
>>
>
_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to