[web2py] Re: need help with unicode decoding/encoding upload file

2012-03-12 Thread Wikus van de Merwe
To convert a string to utf-8 you need to do two operations: - decode the string to unicode (using the original file codec) - encode the unicode string using utf-8 codec This is what decoder.decoder function is doing but it is guessing the original codec. You need to either provide the right codec

[web2py] Re: need help with unicode decoding/encoding upload file

2012-03-12 Thread weheh
Thanks, Wikus. Yes, I know (or at least I think I know -- unicode sometimes makes me feel really stupid) how to encode and decode. I think I even know when to encode and decode, too. In this case, I'm doing a file upload from a component. The upload is getting "stored". Just before storing, I'm try