diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-02-29 15:08:20 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-02-29 15:08:20 +0100 |
commit | 8bbf048085066b8e95256e7d59d7ddd89465d4e7 (patch) | |
tree | 6a994d39d250f04adc5547e57b98b706d52aa74a | |
parent | 2f1ee06df6117d94738df87f9f3cdb159c9389fe (diff) |
fdo#46434: Always send command line arguments as UTF-8
-rw-r--r-- | desktop/unx/source/start.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c index 773c9d0fcd37..f2c6e58db7a1 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 ); |