On 10May2019 1832, Victor Stinner wrote:
I studied code of applications embedding Python. Most of them has to
decode bytes strings to get wchar_t* to set home, argv, program name,
etc. I'm not sure that they use the "correct" encoding, especially
since Python 3.7 got UTF-8 Mode (PEP 540) and C locale coercion (PEP
538).

It looks like Py_DecodeLocale() is available very early on - why wouldn't we recommend using this function? It seems to be nearly a drop-in replacement for mbtowcs in the samples, and if memory allocation is a big deal perhaps we could just add a version that writes to a buffer?

That would provide a supported workaround for the encoding issues and unblock people hitting trouble right now, yes?

Cheers,
Steve
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to