Christian Heimes added the comment:

Alexandre Vassalotti wrote:
> Alexandre Vassalotti added the comment:
> 
> I thought of another way to implement PyUnicode_DecodeFSDefault. If
> Py_FileSystemDefaultEncoding is set, decode with the codecs module,
> otherwise use UTF-8 + replace. This works because when
> Py_FileSystemDefaultEncoding is initialized at the end of
> Py_InitializeEx(), the codecs module is ready to be used. Here's what
> it looks like:

That's almost what I had in mind but with two exceptions for __APPLE__
and MS_WINDOWS. For both OS the value of Py_FileSystemDefaultEncoding is
hard coded to UTF-8 / MBCS. In your code the method would use
PyUnicode_Decode() too early but you can work around the problem with
two #if defined.

Christian

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1272>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to