[PHPTAL] International characters not shown after an upgrade

2008-01-15 Thread Nestor A. Diaz
Hello, i have a simple phptal application, that used to work, except that
2 days ago i decided to do an apt-get update, i tell the system to rebuild
the whole locales, and after that international characters do not shown
anymore, in fact the whole variable that have an international character.

In the next example i use an international character for my títle,
notice the í

Any help will be apreciated.


?php

$src = EOS
html
  head
  title tal:content=titlemy title/title
  /head
  body
h1 tal:content=title my title/h1
  /body
/html
EOS;

require_once 'PHPTAL.php';
$tpl = new PHPTAL();
$tpl-setSource($src);
$tpl-title = 'this is my títle';
try {
echo $tpl-execute();
}
catch (Exception $e){
echo $e;
}

?



-- 
Nestor A. Diaz
Ingeniero de Sistemas
Tel. +57 1-600-5490 x 211
Cel. +57 316-227-3593
Tel. SIP: sip:[EMAIL PROTECTED]
Email/MSN: [EMAIL PROTECTED]
http://www.tiendalinux.com/
Bogota, Colombia


___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] International characters not shown after an upgrade

2008-01-15 Thread James McLean
On Jan 16, 2008 11:30 AM, Nestor A. Diaz [EMAIL PROTECTED] wrote:
 Hello, i have a simple phptal application, that used to work, except that
 2 days ago i decided to do an apt-get update, i tell the system to rebuild
 the whole locales, and after that international characters do not shown
 anymore, in fact the whole variable that have an international character.

 In the next example i use an international character for my títle,
 notice the í

I also noticed a similar issue when developing with locales on one of
my phptal sites, the character in question was the British 'Pound'
symbol defined in the en_GB locale, as used for their currency. I did
not try with another charset other than en_AU which worked as
expected, because it returns a regular dollar-sign ($) rather than the
Pound . I was able to work around the issue by modifying the
'phptal_escape()' function like this:

function phptal_escape($var, $ent, $encoding)
{

if (is_object($var)){
return htmlspecialchars($var-__toString(), $ent, $encoding);
}
if (is_string($var)){

// TODO: work out why this is broken when locales is set to en_GB
//return htmlspecialchars($var, $ent, $encoding);
return htmlspecialchars($var);
}
if (is_bool($var)){
return (int)$var;
}
return $var;
}

I simply worked around it and added that todo on my local machine
because I thought I may have been doing something incorrect with the
locales.

I do not know if this worked in 1.18, as I only added the ability to
change locales to my application after an upgrade to PHPTal 1.1.9 had
been performed; consequently this may be a different issue to the
original poster's issue.

If these help:

$ php -v
PHP 5.2.5-pl1-gentoo (cli) (built: Jan  3 2008 23:38:25)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

vortex ~ # /usr/sbin/apache2ctl -v
Server version: Apache/2.0.58
Server built:   Aug 18 2007 16:26:15

PHPTal: 1.1.9

I did not try PHPTal 1.1.8.

Cheers,

James McLean

___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal