[Bf-committers] Usage of PyUnicode_FromString() in blender 2.50
joeedh at gmail.com
Tue Dec 8 16:43:21 CET 2009
BTW, keep in mind that on windows, argv is always in ascii (not UTF-8).
On Mon, Dec 7, 2009 at 1:44 AM, Yomgui <yomgui1 at gmail.com> wrote:
> I've seen in many places that the Python function PyUnicode_FromString
> (and similar) is used to convert system strings like argv and IO
> If we look at the Python 3.1 documentation
> this function supposes that the input string is UTF-8 encoded.
> That's not a strict rule for all OS. This function should be reserved
> to pass string for runtime usage like if it was given in a script, but
> not for OS/IO strings.
> A better (I know... with just more arguments) function to convert
> system strings is PyUnicode_Decode()
> and use as encoding parameter: Py_FileSystemDefaultEncoding
> Bf-committers mailing list
> Bf-committers at blender.org
More information about the Bf-committers