[Libreoffice-commits] .: desktop/unx

Stephan Bergmann sbergmann at kemper.freedesktop.org
Wed Feb 29 06:08:34 PST 2012


 desktop/unx/source/start.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 8bbf048085066b8e95256e7d59d7ddd89465d4e7
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Feb 29 15:08:20 2012 +0100

    fdo#46434: Always send command line arguments as UTF-8

diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index 773c9d0..f2c6e58 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -496,7 +496,15 @@ send_args( int fd, rtl_uString *pCwdPath )
 
     ustr_debug( "Pass args", pBuffer );
 
-    pOut = ustr_to_str( pBuffer );
+    if ( !rtl_convertUStringToString(
+             &pOut, rtl_uString_getStr( pBuffer ),
+             rtl_uString_getLength( pBuffer ), RTL_TEXTENCODING_UTF8,
+             ( RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
+               | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR ) ) )
+    {
+        fprintf( stderr, "ERROR: cannot convert arguments to UTF-8" );
+        exit( 1 );
+    }
 
     nLen = rtl_string_getLength( pOut ) + 1;
     bResult = ( write( fd, rtl_string_getStr( pOut ), nLen ) == (ssize_t) nLen );


More information about the Libreoffice-commits mailing list