How Does String Conversion Between PyUnicode String and C String Work?
<p>I have a PyUnicode object I'm trying to convert back to a C string (char *).</p>

<p>The way I am trying to do it does not seem to be working. Here is my code:</p>

<pre><code>PyObject * objectCompName = PyTuple_GET_ITEM(compTuple, (Py_ssize_t) 0);
PyObject * ooCompName = PyUnicode_AsASCIIString(objectCompName);
char * compName = PyBytes_AsString(ooCompName);
Py_DECREF(ooCompName);
</code></pre>

<p>Is there another/better way I should be doing this?</p>