sys.setdefaultencoding will work thorough the server execution process. So 
as long it is alive you wont need to call it several times.

It will probably work if you set that up on routes.py or web2py.py so its 
not called per request. 

As long as it fixes your problem i wouldnt care whether it is a bad 
practice. Python 2.7 by default encodes in ascii so there is not a 
workaround other than changing the default encoding.

I believe it fixes encoding issues from strings coming from your app, but 
you will have to encode/decode at some point f you are uploading text files 
from the browser.


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/a50cf2be-2480-4626-9134-ec5f6b5baa4a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to