Re: convert rtl::OUString to char *

2013-09-24 Thread jg
WideCharToMultiByte() indicates that you are working on Windows. At first you need to convert to UTF16 (from UTF8), and then from UTF16 to the desired code page. Have a look at http://code.msdn.microsoft.com/C-UTF-8-Conversion-Helpers-22c0a664 . jg -

Re: convert OUString to char *

2013-09-24 Thread Ariel Constenla-Haile
On Tue, Sep 24, 2013 at 08:07:59PM +0300, K.Misha wrote: > This is original file: > > > > > > And this is my return str1: > > I see only empty lines here, no text, so I don't get what the difference could be. But are you watching the value of str1 inside the debugger, or just printing that

Change text in writer without changing style and formats

2013-09-24 Thread K.Misha
One more question... before changing text i have this: Reference < XTextDocument > xTextDocument (xWriterComponent,UNO_QUERY); Reference< XText > xText = xTextDocument->getText(); rtl::OUString uText = xText->getString(); rtl::OString str = rtl::OUStringToOString( uTe

convert OUString to char *

2013-09-24 Thread K.Misha
I have this code, made with your example: char * getWText( char * text ) { Reference < XTextDocument > xTextDocument (xWriterComponent,UNO_QUERY); Reference< XText > xText = xTextDocument->getText(); rtl::OUString uText = xText->getString(); rtl::OString str = rtl:

Re: convert rtl::OUString to char *

2013-09-24 Thread Ariel Constenla-Haile
Hi, On Tue, Sep 24, 2013 at 06:44:05PM +0300, K.Misha wrote: > Hi! > > > > I habe this code: > > > > Reference < XTextDocument > xTextDocument (xWriterComponent,UNO_QUERY); > > Reference< XText > xText = xTextDocument->getText(); > > > > How can i convert xTextDocument->getText() to c

Re: convert rtl::OUString to char *

2013-09-24 Thread jg
WideCharToMultiByte() indicates that you are working on Windows. At first you need to convert to UTF16 (from UTF8), and then from UTF16 to the desired code page. Have a look at http://code.msdn.microsoft.com/C-UTF-8-Conversion-Helpers-22c0a664 . jg

convert rtl::OUString to char *

2013-09-24 Thread K.Misha
Hi! I habe this code: Reference < XTextDocument > xTextDocument (xWriterComponent,UNO_QUERY); Reference< XText > xText = xTextDocument->getText(); How can i convert xTextDocument->getText() to char * ? I used to convert it like this: int nLenOfAnsiChar = WideCharToMultiByte(CP_