idl/source/prj/command.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
New commits: commit d7100211be8c79d00f6044e76e2102206dad9432 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Wed Feb 8 15:45:45 2023 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Wed Feb 8 16:03:33 2023 +0000 Fix bogus uses of OUString::createFromAscii We got a report on IRC of builds failing with > svidl: /home/dolezvo1/Downloads/libreoffice/sal/rtl/ustring.cxx:278: void rtl_uString_newFromAscii(rtl_uString**, const char*): Assertion `static_cast<unsigned char>(*pCharStr) < 0x80' failed. when the "l" in "Downloads" was some non-ASCII character (whose exact identity was apparently obscured by the used pastebin service, though). Change-Id: Ib460793b0f8aa5e8f8822fa224d67e5a622a234d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146664 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/idl/source/prj/command.cxx b/idl/source/prj/command.cxx index 0c9436ce313e..e73d9615c776 100644 --- a/idl/source/prj/command.cxx +++ b/idl/source/prj/command.cxx @@ -23,6 +23,7 @@ #include <stdio.h> #include <osl/diagnose.h> +#include <osl/thread.h> #include <rtl/character.hxx> #include <command.hxx> @@ -127,12 +128,14 @@ bool ReadIdl( SvIdlWorkingBase * pDataBase, const SvCommand & rCommand ) static bool ResponseFile( std::vector<OUString> * pList, int argc, char ** argv ) { // program name - pList->push_back( OUString::createFromAscii(*argv) ); + pList->push_back( OStringToOUString(*argv, osl_getThreadTextEncoding()) ); for( int i = 1; i < argc; i++ ) { if( '@' == **(argv +i) ) { // when @, then response file - SvFileStream aStm( OUString::createFromAscii((*(argv +i)) +1), StreamMode::STD_READ ); + SvFileStream aStm( + OStringToOUString((*(argv +i)) +1, osl_getThreadTextEncoding()), + StreamMode::STD_READ ); if( aStm.GetError() != ERRCODE_NONE ) return false; @@ -158,7 +161,7 @@ static bool ResponseFile( std::vector<OUString> * pList, int argc, char ** argv } } else if( argv[ i ] ) - pList->push_back( OUString::createFromAscii( argv[ i ] ) ); + pList->push_back( OStringToOUString( argv[ i ], osl_getThreadTextEncoding() ) ); } return true; }