[mod_python] [help]please give an input filter example ?

camge is83070 at cis.nctu.edu.tw
Fri Sep 19 11:09:14 EST 2003


> >I need input filter to convert character set of form data submitted by
cell
> >phone browser.
> >For example, convert utf-8 to big5 or gb.
> >If I can do it in input filter, then I dont need to modify all of my
pages.
> >
> >
> Aha. What I would do is just put a function in a module that changes the
> encoding.
> Get the arguments like you normally would, then just do a decode/encode.
> Since that module can be accessed from anywhere, it will work just as
well.
> Also, it's less likely to cause bugs, and will probably be faster
> (you'll only making one jump into the Python interpreter and back)
>
> Cheers
> David
>
Thanks for your suggestion!
But my web server serve not only wap browser but also Pocket IE and IE,
and they all use same module(for easy maintenance).
Adding this function in these modules will be a terrible thing,
because I dont need to convert character encoding for Pocket IE and IE.

If I can do it in input filter, I don't need to modify any things in
original module.

regards,
camge




More information about the Mod_python mailing list