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

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.


James McLean

PHPTAL mailing list

Reply via email to