TT and UTF8?

Dave Hodgkinson davehodg at gmail.com
Fri Jan 29 23:10:26 GMT 2010


On 29 Jan 2010, at 19:07, Dave Cross wrote:
> 
> There's a Perlanet fork that has a hack for dealing correctly with Templates that contain UTF-9 whether or not they contain a BOM.
> 
> http://github.com/kappa/perlanet/blob/master/lib/Perlanet.pm
> 
> It does it by overriding the Template::Provider::_decode_unicode subroutine.

So you're saying this is a problem you've had?

I've turned off caching in TT, inserted "Motörhead múm" into the
template as static text and a BOM (od -x 0000000 bbef 3cbf...) as
the first octets. Works first time, fails second.

I parse this out of the final string abd is also printed using an octet
unpicker:

[Fri Jan 29 22:55:48 2010] -e: Motörhead
[Fri Jan 29 22:55:48 2010] -e: 4d6f74c3b67268656164 

Looks about right. when it fails: 

[Fri Jan 29 22:55:52 2010] -e: Motörhead 
[Fri Jan 29 22:55:52 2010] -e: 4d6f74c3b67268656164

As far as I'm concerned it's getting mangled *after* I've unleashed it
to apache. It's a low traffic app. I'm sorely tempted to load up a
startup.pl and set MaxRequestsPerClient to 1.

-- 
Dave Hodgkinson                                MSN: davehodg at hotmail.com
Site: http://www.davehodgkinson.com                  UK: +44 7768 490620
Blog: http://www.davehodgkinson.com/blog
Photos: http://www.flickr.com/photos/davehodg











More information about the london.pm mailing list