{'test': '\\xa4\\xa4\\xa4\\xe5'}
 call <bound method CacheFilter.before_main of
<cherrypy.filters.cachefilter.CacheFilter object at 0x05B11EB0>>
 {'test': '\\xa4\\xa4\\xa4\\xe5'}
 call <bound method LogDebugInfoFilter.before_main of
<cherrypy.filters.logdebuginfofilter.LogDebugInfoFilter object at
0x05B59250>>
 {'test': '\\xa4\\xa4\\xa4\\xe5'}
 call <bound method BaseUrlFilter.before_main of
<cherrypy.filters.baseurlfilter.BaseUrlFilter object at 0x05B59550>>
 {'test': '\\xa4\\xa4\\xa4\\xe5'}
 call <bound method VirtualHostFilter.before_main of
<cherrypy.filters.virtualhostfilter.VirtualHostFilter object at
0x05B59590>>
 {'test': '\\xa4\\xa4\\xa4\\xe5'}
 call <bound method MonkeyDecodingFilter.before_main of
<turbogears.visit.api.MonkeyDecodingFilter object at 0x05B90F70>>
 {'test': u'\\xa4\\xa4\\xa4\\xe5'}
 call <bound method SessionFilter.before_main of
<cherrypy.filters.sessionfilter.SessionFilter object at 0x05B59570>>
 {'test': u'\\xa4\\xa4\\xa4\\xe5'}
 call <bound method SessionAuthenticateFilter.before_main of
<cherrypy.filters.sessionauthenticatefilter.SessionAuthenticateFilter
object at 0x05B59B50>>
 {'test': u'\\xa4\\xa4\\xa4\\xe5'}
 call <bound method StaticFilter.before_main of
<cherrypy.filters.staticfilter.StaticFilter object at 0x05B59AD0>>
 {'test': u'\\xa4\\xa4\\xa4\\xe5'}
 call <bound method NsgmlsFilter.before_main of
<cherrypy.filters.nsgmlsfilter.NsgmlsFilter object at 0x05B63EB0>>
 {'test': u'\\xa4\\xa4\\xa4\\xe5'}
 call <bound method TidyFilter.before_main of
<cherrypy.filters.tidyfilter.TidyFilter object at 0x05B63970>>
 {'test': u'\\xa4\\xa4\\xa4\\xe5'}
 call <bound method XmlRpcFilter.before_main of
<cherrypy.filters.xmlrpcfilter.XmlRpcFilter object at 0x05B634F0>>
 {'test': u'\\xa4\\xa4\\xa4\\xe5'}
 call <bound method MonkeyDecodingFilter.before_main of
<turbogears.visit.api.MonkeyDecodingFilter object at 0x05B90F70>>
 {'test': u'\\xa4\\xa4\\xa4\\xe5'}
 call <bound method EndTransactionsFilter.before_main of
<turbogears.database.EndTransactionsFilter object at 0x05B5B890>>
 {'test': u'\\xa4\\xa4\\xa4\\xe5'}
 call <bound method NestedVariablesFilter.before_main of
<turbogears.startup.NestedVariablesFilter object at 0x05B5B8D0>>
 {'test': u'\\xa4\\xa4\\xa4\\xe5'}
 call <bound method VisitFilter.before_main of
<turbogears.visit.api.VisitFilter object at 0x05B90450>>
 {'test': '\\xc2\\xa4\\xc2\\xa4\\xc2\\xa4\\xc3\\xa5'}
 end applyFilters
 {'test': '\\xc2\\xa4\\xc2\\xa4\\xc2\\xa4\\xc3\\xa5'}
 {'test': '\\xc2\\xa4\\xc2\\xa4\\xc2\\xa4\\xc3\\xa5'}

This is the log I print about the change of parameters between
"before_main" filters

On 1月18日, 下午11時08分, Victor <[EMAIL PROTECTED]> wrote:
> I spend all my night to look source code....
> I found the decodingfilter do not be called.
>
>     def decode(self, enc):
>         decodedParams = {}
>         raise 'test'
>
> I add piece code the test does TurboGears decode data by
> DecodingFilter.
> But it is strange. Cherrypy never reach, "raise 'test'" this line.
>
> Unless I add this to my root controller
>
> from cherrypy.filters.decodingfilter import DecodingFilter
>
> class Root(controllers.RootController):
>     _cp_filters = [DecodingFilter(),]
>
> And then cherrypy use DecodingFilter to do his job.
> But this cause UnicodeEncodeError: 'ascii' codec can't encode
> characters in position 0-1: ordinal not in range(128)
>
> Because another strange thing is : All parameters goes into
> DecodingFilter are all unicode string.
> So if the DecodingFilter work. It double decode the unicode string.
>
> Now I am going to see who decode parameters before DecodingFilter.
> And who encode parameters again.
>
> On 1月17日, 下午5時49分, "Florent Aide" <[EMAIL PROTECTED]> wrote:
>
> > 2008/1/17 Victor <[EMAIL PROTECTED]>:
>
> > > Request Headers:
> > >   REFERER:http://127.0.0.1/offline/article_editor/?article_id=31
> > >   KEEP-ALIVE: 300
> > >   ACCEPT-CHARSET: Big5,utf-8;q=0.7,*;q=0.7
>
> > [...]
>
> > > This is a request example.
>
> > > [Thu Jan 17 15:42:47 2008] [error] '\\xe4\\xb8\\xad\\xe6\\x96\\x87'
>
> > > This is the title non-decoded string I print in application
> > > print repr(Kwargs['modify_title'])
>
> > > Not only this example. Every params seems did not be decoded.
>
> > > On 1月17日, 下午2時31分, "Florent Aide" <[EMAIL PROTECTED]> wrote:
>
> > I verified and the filter is correctly doing its job (decoding the
> > params to unicode objects).
> > _But_ what we receive in the controller is an utf-8 encoded string and
> > not the expected unicode object. This means something else as
> > re-encoded the params to utf-8.
>
> > This is the same comportment I get with CP 2.2.1. For the moment,
> > consider all the strings to be utf-8 encoded, I'll look into why we
> > don't receive the expected unicode object tonight.
>
> > Cheers,
> > Florent.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to