Writing python module in C: wchar_t or Py_UNICODE?

Yury yb at icmail.net
Sat Mar 17 10:43:11 EDT 2007


Carsten Haese wrote:
>
> You should familiarize yourself with the Python/C API documentation. It
> contains the answers to all the above questions.
>
> http://docs.python.org/api/arg-parsing.html says this about the "u"
> format character: "a pointer to the existing Unicode data is stored into
> the Py_UNICODE pointer variable whose address you pass."
>
> http://docs.python.org/api/unicodeObjects.html says this about
> Py_UNICODE: "On platforms where wchar_t is available and compatible with
> the chosen Python Unicode build variant, Py_UNICODE is a typedef alias
> for wchar_t to enhance native platform compatibility."
>
> The first quote says that, to be strictly correct, "login" should be a
> "Py_UNICODE*", but the second quote says that under the right
> circumstances, Py_UNICODE is the same as wchar_t. It's up to you to
> determine if your platform provides the right circumstances for this to
> be the case.
>
> Hope this helps,
>
> Carsten.

Thanks for reply,
sorry for asking questions while not checked the manual.
Also sorry for my wierd english :)




More information about the Python-list mailing list