On 9 Jun 2012, at 11:00, phptal-requ...@lists.motion-twin.com 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. Remember this is a php5.4 
issue only as 5.3 works without problem. However i will investigate the filters 
also as a workaround.

Thanks,
Hash

> Of course I also research. :)
> 
> -- 
> Hisateru Tanaka


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

Reply via email to