On Mon, Nov 21, 2011 at 7:05 AM, Marc <mrec...@gmail.com> wrote:
> OK I found a clue regarding that issue:
> print(sys.getfilesystemencoding()) at the console prompt produces
> 'UTF-8' whereas in the failing script ' ANSI_X3.4-1968'. I now
> understand why the conversion fails (in that case Python returns a
> byte string and this is not documented in Python doc).
>
> Is the problem in mod_wsgi ?
>
> Thanks
>

No.

sys.getfilesystemencoding()
Return the name of the encoding used to convert Unicode filenames into
system file names, or None if the system default encoding is used. The
result value depends on the operating system:

On Mac OS X, the encoding is 'utf-8'.
On Unix, the encoding is the user’s preference according to the result
of nl_langinfo(CODESET), or None if the nl_langinfo(CODESET) failed.

It returns what you have configured it to return. If you want Apache
(and hence, mod_wsgi and then your python interpreter) to handle the
file system as UTF-8, then configure it to do so by setting the LANG
environment variable, either in an Apache startup script (envvars
exists for this purpose), or with SetEnv in the main conf file.

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to