Hash | 9 Jun 2012 12:14
Picon

Re: PHP5.4 compatibility

On 9 Jun 2012, at 11:00, phptal-request@... wrote:

>> Hi, PHPTAL 1.2.2 running with euc-jp works fine under php 5.3 but outputs
>> blank with php 5.4 because htmlspecialchars skips processing if the detected
>> input encoding is not the same as specified (or the default utf8 which is
>> the current behaviour).
> 
> How about using expression modifier to convert to utf-8?
> http://phptal.org/manual/en/split/custom-modifiers.html
> 
> <p tal:content="eucjp2utf8:your/variable">non ascii text here</p>
> 

Hi thanks for the suggestion.
Using custom modifier globally for all content does not seem appropriate in this case. However, for
specific elements i can understand its usefulness.

> Though euc-jp is better encoding before spreading utf-8, currently it
> becoming obsolete around modern PHP community. PSR-1 specifies to use
> only utf-8 with MUST level. See:
> https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md
> 
> If you have so much existing non utf-8 htmls or you have some reason
> to output with euc-jp I prefer to use pre/post filters. They can do
> anything your text nodes and can convert the result from internally
> used utf-8 to euc-jp to output.
> 

This particular project requires EUC-JP so i have to use it. Other projects use UTF-8. I have configured
PHPTal encoding to EUC-JP so it would make sense for it to also honour the encoding for output as well.
(Continue reading)

Hisateru Tanaka | 9 Jun 2012 19:38
Picon
Gravatar

Re: Re: PHP5.4 compatibility

2012/6/9 Hash <mr.hash@...>:
> Remember this is a php5.4 issue only as 5.3 works without problem.

I tried and it looks working fine:
https://github.com/pornel/PHPTAL/commit/eca3d48b882324b309b97fb3ab72716a4d1a0d01

To include 5.4 in supported platform before the next release, someone
please test above.

Thanks

--

-- 
Hisateru Tanaka
Marco Pivetta | 9 Jun 2012 23:35
Picon
Gravatar

Re: Re: PHP5.4 compatibility

I just checked the travis build (don't have 5.4 myself here) at http://travis-ci.org/#!/pornel/PHPTAL/jobs/1578050 and it seems ok (well, ok-ish... your test is passing).
Marco Pivetta

http://twitter.com/Ocramius     

http://marco-pivetta.com    



On 9 June 2012 19:38, Hisateru Tanaka <tanakahisateru-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
2012/6/9 Hash <mr.hash-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
> Remember this is a php5.4 issue only as 5.3 works without problem.

I tried and it looks working fine:
https://github.com/pornel/PHPTAL/commit/eca3d48b882324b309b97fb3ab72716a4d1a0d01

To include 5.4 in supported platform before the next release, someone
please test above.

Thanks

--
Hisateru Tanaka

_______________________________________________
PHPTAL mailing list
PHPTAL-CzyLcWPZiU5MT9OEwdum/5sJf8rGwyy7@public.gmane.orgm
http://lists.motion-twin.com/mailman/listinfo/phptal

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

Gmane