오종암 schrieb:
> My kid.encoding is 'utf-8', so everything have been good work.
> but My turbogears app must be connected in another machine that knows
> only 'euc-kr' encoding.
> so I want to know how to encode only one function to 'euc-kr' in my
> controller.py, but others are 'utf-8'
>
> ...
>
> I want to convert just 'toAnotheMachine' function's encoding to 'euc-kr'
> exception 'index' function.
> Is this possible?
> How can I do this?
You need to set up a euc_kr serializer for Kid, like so:
import kid
euc_kr = kid.HTMLSerializer(encoding='euc-kr')
Then you can expose your controller like that:
@expose(template="...", format=euc_kr)
In your app.cfg you must also set kid.encoding=None, because otherwise
the kid.encoding will override your serializer's encoding.
On tg-trunk we're just discussing an improvement of TG's Buffet
interface that will allow overloading engine options at render time.
It then will be possible to do something like
@expose(template="...", options={'kid.encoding': 'euc-kr'})
But that is currently not yet possible.
-- Christoph
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---