Wednesday, September 29, 2010

Re: UnicodeEncodeError

Isn't the filename a string?

It may not be the solution but I think you should try them at least since they are very quick to apply. As I saw something implying os module I thought that before Django handles the string, it must encode by os module.

I found that using previously written steps and explicitly set encoding with "codecs" module while working with text files got rid of my problems encontered with unicode. The fact is that at different levels, there are assumptions on the encoding used while executing it and using utf-8 doesn't make you application work with unicode objects at all levels. When those problem arise, one of the three solutions always end it in my very short python existence.

Regards

No comments:

Post a Comment