Thank you for your reply. On Tue, Apr 26, 2011 at 1:16 PM, Mathias Bauer <nospamfor...@gmx.de> wrote:
> On 26.04.2011 08:07, Rohit Kulkarni wrote: > >> How do I convert OUString to normal const char * in .cxx file. >> Because I am using ldap_open(const char*,int) function which has const >> char* as parameter. >> >> Regards, >> Rohit >> > > rtl::OUString objects contain UniCode strings. If you want to convert them > to a char* you need to provide an encoding that shall be used, e.g. > RTL_TEXTENCODING_UTF8. With this encoding you can do it this way: > > const char* p = rtl::OString( > myOUString.getStr(), myOUString.getLength(), > RTL_TEXTENCODING_UTF8 ).getStr(); > > Regards, > Mathias > > -- > Mathias Bauer (mba) - Project Lead OpenOffice.org Writer > OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS > Please don't reply to "nospamfor...@gmx.de". > I use it for the OOo lists and only rarely read other mails sent to it. > -- > ----------------------------------------------------------------- > To unsubscribe send email to dev-unsubscr...@openoffice.org > For additional commands send email to sy...@openoffice.org > with Subject: help > -- ----------------------------------------------------------------- To unsubscribe send email to dev-unsubscr...@openoffice.org For additional commands send email to sy...@openoffice.org with Subject: help