title: Python: Passing unicode string to C++ module
body: <p>I'm working with an existing module at the moment that provides a C++ interface and does a few operations with strings.</p>
  
  <p>I needed to use Unicode strings and the module unfortunately didn't have any support for a Unicode interface, so I wrote an extra function to add to the interface:</p>
  
  <pre><code>void SomeUnicodeFunction(const wchar_t* string)
  </code></pre>
  
  <p>However, when I attempt to use the following code in Python:</p>
  
  <pre><code>SomeModule.SomeUnicodeFunction(ctypes.c_wchar_p(unicode_string))
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>ArgumentError: Python argument types in
      SomeModule.SomeUnicodeFunction(SomeModule, c_wchar_p)
  did not match C++ signature:
      SomeUnicodeFunction(... {lvalue}, wchar_t const*)
  </code></pre>
  
  <p>(names have been changed).</p>
  
  <p>I've tried changing wchar_t in the C++ module to Py_UNICODE with no success. How do I solve this problem?</p>