[C++-sig] Re: Automatic PyUnicode to 'const char*'

David Abrahams dave at boost-consulting.com
Thu Jul 31 15:07:34 CEST 2003


"Lijun Qin" <qinlj at solidshare.com> writes:

> Hi all,
>
> I'm using boost.python to wrap the WTL (Windows Template Libaray), using VC
> 7.1 and porting some old code previously use win32ui.pyd.
> Basically it is easy to do, though gccxml failed to parse the ATL/WTL code
> so I can not use Pyste.
> But there is a trouble, does anybody know how to automaticly convert
> PyUnicode to 'const char *'? Without this, I have to change lot of code
> lines to explictly use str() function.

I'm not an expert in it, but I thought Unicode used 16- or 32- byte
wchar_t characters.  How would you convert it to char const*?

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com





More information about the Cplusplus-sig mailing list