[Python-Dev] unicode/string asymmetries

Neil Hodgson nhodgson@bigpond.net.au
2002年1月10日 08:41:52 +1100


Martin:
> Unfortunately, that is quite difficult. Python does not guarantee that
> the internal representation of Unicode strings uses wchar_t, so such a
> conversion definitely requires explicit memory management.

 This could be a problem with my file patches as I have been using
PyUnicode_AS_UNICODE which will 4 byte strings if Py_UNICODE_WIDE is
defined. 4 byte strings can not be passed to the Windows API. So it looks
like PyUnicode_AsWideChar has to be used instead with a wrapper to allocate
enough memory to hold the resulting string.
 Neil

AltStyle によって変換されたページ (->オリジナル) /