Unicode issue - historical and probably trivial

View: New views
2 Messages — Rating Filter:   Alert me  

Unicode issue - historical and probably trivial

by Paul Mothersdill :: Rate this Message:

| View Threaded | Show Only this Message

I have a number of templates written many years ago as part of a
Python/MySQL/mod_python setup on a Ubuntu server. No problems, no
further development and I'd almost forgotten there were Cheetah
templates in there.

The Ubuntu box has been upgraded as per the normal cycles. The latest
upgrade (10.10 to 11.04 which included Python 2.7 and Cheetah 2.4.3)
led to the system sending utf-8 to the web browser, rather than 8859-1
as previously. I've attempted to isolate the problem, and I think it's
Cheetah (the last link before mod_python sends the stuff to the
browser) that's now receiving 8859-1 and outputting utf-8 (something
it presumably didn't do in the version that was packaged in Ubuntu
10.10).

Is this correct, and if so is there a simple way to get Cheetah to
output 8859-1 (can't find anything in the documentation)?

pm

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Cheetahtemplate-discuss mailing list
Cheetahtemplate-discuss@...
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss

Re: Unicode issue - historical and probably trivial

by R. Tyler Ballance :: Rate this Message:

| View Threaded | Show Only this Message


On Tue, 05 Jul 2011, Paul Mothersdill wrote:

> I have a number of templates written many years ago as part of a
> Python/MySQL/mod_python setup on a Ubuntu server. No problems, no
> further development and I'd almost forgotten there were Cheetah
> templates in there.
>
> The Ubuntu box has been upgraded as per the normal cycles. The latest
> upgrade (10.10 to 11.04 which included Python 2.7 and Cheetah 2.4.3)
> led to the system sending utf-8 to the web browser, rather than 8859-1
> as previously. I've attempted to isolate the problem, and I think it's
> Cheetah (the last link before mod_python sends the stuff to the
> browser) that's now receiving 8859-1 and outputting utf-8 (something
> it presumably didn't do in the version that was packaged in Ubuntu
> 10.10).
>
> Is this correct, and if so is there a simple way to get Cheetah to
> output 8859-1 (can't find anything in the documentation)?
By default, now at least, Cheetah should be generating unicode objects, so
what's being handled by the application or mod_python might be encoding it in
some form or fashion.

(mod_python is EOLd by the way, bewares)

You can (IIRC) tell Cheetah to output a specific encoding with the #encoding
directive at the top of the template.


Cheers
- R. Tyler Croy
--------------------------------------
    Code: http://github.com/rtyler
 Chatter: http://identi.ca/agentdero
          http://twitter.com/agentdero


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Cheetahtemplate-discuss mailing list
Cheetahtemplate-discuss@...
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss

attachment0 (205 bytes) Download Attachment