diff options
Diffstat (limited to 'connectivity/source')
11 files changed, 32 insertions, 22 deletions
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index 86a2dc6c7919..47d3472ca7a6 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -1946,7 +1946,7 @@ bool ODbaseTable::UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow, cons aStringToSubstitutes.push_back(::std::pair<const sal_Char* , OUString >("$columnname$", aColName)); aStringToSubstitutes.push_back(::std::pair<const sal_Char* , OUString >("$precision$", OUString::number(nLen))); aStringToSubstitutes.push_back(::std::pair<const sal_Char* , OUString >("$scale$", OUString::number(nScale))); - aStringToSubstitutes.push_back(::std::pair<const sal_Char* , OUString >("$value$", OUString::fromUtf8(aDefaultValue))); + aStringToSubstitutes.push_back(::std::pair<const sal_Char* , OUString >("$value$", OStringToOUString(aDefaultValue,RTL_TEXTENCODING_UTF8))); const OUString sError( getConnection()->getResources().getResourceStringWithSubstitution( STR_INVALID_COLUMN_DECIMAL_VALUE diff --git a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx index 4bc4f316fe0a..c53523b5d479 100644 --- a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx +++ b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx @@ -214,7 +214,8 @@ namespace connectivity if( pSpec ) { - aName = OUString::fromUtf8( g_param_spec_get_name( ( GParamSpec * )pSpec ) ); + aName = OStringToOUString( g_param_spec_get_name( ( GParamSpec * )pSpec ), + RTL_TEXTENCODING_UTF8 ); aName = aName.replace( '-', '_' ); } return aName; @@ -1154,10 +1155,12 @@ Reference< XResultSet > SAL_CALL OEvoabDatabaseMetaData::getTables( ODatabaseMetaDataResultSet::ORow aRow(3); aRow.reserve(6); - OUString aHumanName = OUString::fromUtf8( e_source_get_display_name( pSource ) ); + OUString aHumanName = OStringToOUString( e_source_get_display_name( pSource ), + RTL_TEXTENCODING_UTF8 ); aRow.push_back(new ORowSetValueDecorator(aHumanName)); //tablename aRow.push_back(new ORowSetValueDecorator(aTable)); - OUString aUID = OUString::fromUtf8( e_source_get_uid( pSource ) ); + OUString aUID = OStringToOUString( e_source_get_uid( pSource ), + RTL_TEXTENCODING_UTF8 ); aRow.push_back(new ORowSetValueDecorator(aUID)); //comment //I'd prefer to swap the comment and the human name and //just use e_source_registry_ref_source(get_e_source_registry(), aUID); @@ -1204,7 +1207,8 @@ Reference< XResultSet > SAL_CALL OEvoabDatabaseMetaData::getTables( { ESource *pSource = E_SOURCE (s->data); - OUString aName = OUString::fromUtf8( e_source_peek_name( pSource ) ); + OUString aName = OStringToOUString( e_source_peek_name( pSource ), + RTL_TEXTENCODING_UTF8 ); ODatabaseMetaDataResultSet::ORow aRow(3); aRow.reserve(6); diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx index 59c9cf67db5c..bbf643c78a7e 100644 --- a/connectivity/source/drivers/evoab2/NResultSet.cxx +++ b/connectivity/source/drivers/evoab2/NResultSet.cxx @@ -98,7 +98,7 @@ valueToOUString( GValue& _rValue ) { const char *pStr = g_value_get_string( &_rValue ); OString aStr( pStr ? pStr : "" ); - OUString sResult( OUString::fromUtf8( aStr ) ); + OUString sResult( OStringToOUString( aStr, RTL_TEXTENCODING_UTF8 ) ); g_value_unset( &_rValue ); return sResult; } diff --git a/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx b/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx index 084cefd35083..8e6a0746383c 100644 --- a/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx +++ b/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx @@ -110,7 +110,8 @@ OUString SAL_CALL OEvoabResultSetMetaData::getColumnLabel( sal_Int32 nColumnNum OUString aLabel; if( pSpec ) - aLabel = OUString::fromUtf8( g_param_spec_get_nick( (GParamSpec *) pSpec ) ); + aLabel = OStringToOUString( g_param_spec_get_nick( (GParamSpec *) pSpec ), + RTL_TEXTENCODING_UTF8 ); return aLabel; } diff --git a/connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx b/connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx index 136734306be7..c4a239ade780 100644 --- a/connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx +++ b/connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx @@ -60,7 +60,7 @@ bool MDatabaseMetaDataHelper::getTableStrings( OConnection* _pCon, std::set<std::string> lists; _pCon->getMorkParser("AddressBook")->retrieveLists(lists); for (::std::set<std::string>::iterator iter = lists.begin(); iter != lists.end(); ++iter) { - OUString groupTableName = OUString::fromUtf8((*iter).c_str()); + OUString groupTableName = OStringToOUString((*iter).c_str(), RTL_TEXTENCODING_UTF8); SAL_INFO("connectivity.mork", "add Table " << groupTableName); _rStrings.push_back(groupTableName); diff --git a/connectivity/source/drivers/mork/MNSINIParser.cxx b/connectivity/source/drivers/mork/MNSINIParser.cxx index ff8f932ff12b..b33baa1e82df 100644 --- a/connectivity/source/drivers/mork/MNSINIParser.cxx +++ b/connectivity/source/drivers/mork/MNSINIParser.cxx @@ -60,7 +60,8 @@ IniParser::IniParser(OUString const & rIniName) throw(com::sun::star::io::IOExce struct ini_NameValue nameValue; nameValue.sName = OStringToOUString( line.copy(0,nIndex).trim(), RTL_TEXTENCODING_ASCII_US ); - nameValue.sValue = OUString::fromUtf8( line.copy(nIndex+1).trim() ); + nameValue.sValue = OStringToOUString( + line.copy(nIndex+1).trim(), RTL_TEXTENCODING_UTF8 ); aSection->lList.push_back(nameValue); diff --git a/connectivity/source/drivers/mork/MQueryHelper.cxx b/connectivity/source/drivers/mork/MQueryHelper.cxx index 1fff2cc8b510..686af4e09148 100644 --- a/connectivity/source/drivers/mork/MQueryHelper.cxx +++ b/connectivity/source/drivers/mork/MQueryHelper.cxx @@ -243,7 +243,7 @@ sal_Int32 MQueryHelper::executeQuery(OConnection* xConnection, MQueryExpression std::string value = xMork->getValue(CellsIter->second); OString key(column.c_str(), static_cast<sal_Int32>(column.size())); OString valueOString(value.c_str(), static_cast<sal_Int32>(value.size())); - OUString valueOUString = OUString::fromUtf8( valueOString ); + OUString valueOUString = OStringToOUString( valueOString, RTL_TEXTENCODING_UTF8 ); entry->setValue(key, valueOUString); } ::std::vector< sal_Bool > vector = entryMatchedByExpression(this, &expr, entry); diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx index 9450a8a2b722..9b36e68f2fd0 100644 --- a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx +++ b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx @@ -67,7 +67,8 @@ IniParser::IniParser(OUString const & rIniName) throw(com::sun::star::io::IOExce struct ini_NameValue nameValue; nameValue.sName = OStringToOUString( line.copy(0,nIndex).trim(), RTL_TEXTENCODING_ASCII_US ); - nameValue.sValue = OUString::fromUtf8( line.copy(nIndex+1).trim() ); + nameValue.sValue = OStringToOUString( + line.copy(nIndex+1).trim(), RTL_TEXTENCODING_UTF8 ); aSection->lList.push_back(nameValue); diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx b/connectivity/source/drivers/postgresql/pq_tools.cxx index e077f8420109..17428fd96fe2 100644 --- a/connectivity/source/drivers/postgresql/pq_tools.cxx +++ b/connectivity/source/drivers/postgresql/pq_tools.cxx @@ -125,7 +125,7 @@ void bufferEscapeConstant( OUStringBuffer & buf, const OUString & value, Connect strbuf.setLength( len ); // Previously here RTL_TEXTENCODING_ASCII_US; as we set the PostgreSQL client_encoding to UTF8, // we get UTF8 here, too. I'm not sure why it worked well before... - buf.append( OUString::fromUtf8( strbuf.makeStringAndClear() ) ); + buf.append( OStringToOUString( strbuf.makeStringAndClear(), RTL_TEXTENCODING_UTF8 ) ); } static inline void ibufferQuoteConstant( OUStringBuffer & buf, const OUString & value, ConnectionSettings *settings ) @@ -168,7 +168,7 @@ static inline void ibufferQuoteIdentifier( OUStringBuffer & buf, const OUString -1, Any()); } - buf.append( OUString::fromUtf8( cstr ) ); + buf.append( OStringToOUString( cstr, RTL_TEXTENCODING_UTF8 ) ); PQfreemem( cstr ); } @@ -553,11 +553,11 @@ void splitConcatenatedIdentifier( const OUString & source, OUString *first, OUSt { case 1: *first = OUString(); - *second = OUString::fromUtf8( vec[0] ); + *second = OStringToOUString( vec[0], RTL_TEXTENCODING_UTF8 ); break; case 3: - *first = OUString::fromUtf8( vec[0] ); - *second = OUString::fromUtf8( vec[2] ); + *first = OStringToOUString( vec[0], RTL_TEXTENCODING_UTF8 ); + *second = OStringToOUString( vec[2], RTL_TEXTENCODING_UTF8 ); break; default: SAL_WARN("connectivity.postgresql", @@ -706,12 +706,15 @@ com::sun::star::uno::Sequence< sal_Int32 > parseIntArray( const OUString & str ) { sal_Int32 start = 0; IntVector vec; +// printf( ">%s<\n" , OUStringToOString( str, RTL_TEXTENCODING_UTF8 ).getStr() ); for( sal_Int32 i = str.indexOf( ' ' ) ; i != -1 ; i = str.indexOf( ' ', start) ) { vec.push_back( (sal_Int32)rtl_ustr_toInt32( &str.pData->buffer[start], 10 ) ); +// printf( "found %d\n" , rtl_ustr_toInt32( &str.pData->buffer[start], 10 )); start = i + 1; } vec.push_back( (sal_Int32)rtl_ustr_toInt32( &str.pData->buffer[start], 10 ) ); +// printf( "found %d\n" , rtl_ustr_toInt32( &str.pData->buffer[start], 10 )); return sequence_of_vector(vec); } diff --git a/connectivity/source/parse/sqlflex.l b/connectivity/source/parse/sqlflex.l index ae8a1b2db351..330a853c9d75 100644 --- a/connectivity/source/parse/sqlflex.l +++ b/connectivity/source/parse/sqlflex.l @@ -523,13 +523,13 @@ sal_Int32 gatherString(int delim, sal_Int32 nTyp) switch(nTyp) { case 0: - SQL_NEW_NODE(::rtl::OUString::fromUtf8(sBuffer.makeStringAndClear()), SQL_NODE_NAME); + SQL_NEW_NODE(::rtl::OStringToOUString(sBuffer.makeStringAndClear(),RTL_TEXTENCODING_UTF8), SQL_NODE_NAME); return SQL_TOKEN_NAME; case 1: - SQL_NEW_NODE(::rtl::OUString::fromUtf8(sBuffer.makeStringAndClear()), SQL_NODE_STRING); + SQL_NEW_NODE(::rtl::OStringToOUString(sBuffer.makeStringAndClear(),RTL_TEXTENCODING_UTF8), SQL_NODE_STRING); return SQL_TOKEN_STRING; case 2: - SQL_NEW_NODE(::rtl::OUString::fromUtf8(sBuffer.makeStringAndClear()), SQL_NODE_ACCESS_DATE); + SQL_NEW_NODE(::rtl::OStringToOUString(sBuffer.makeStringAndClear(),RTL_TEXTENCODING_UTF8), SQL_NODE_ACCESS_DATE); return SQL_TOKEN_ACCESS_DATE; } } diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index c767867cf47e..eb2abedff3d2 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -1603,7 +1603,7 @@ OSQLParseNode::OSQLParseNode(const OString &_rNewValue, SQLNodeType eNewNodeType, sal_uInt32 nNewNodeID) :m_pParent(NULL) - ,m_aNodeValue(OUString::fromUtf8(_rNewValue)) + ,m_aNodeValue(OStringToOUString(_rNewValue,RTL_TEXTENCODING_UTF8)) ,m_eNodeType(eNewNodeType) ,m_nNodeID(nNewNodeID) { @@ -2301,7 +2301,7 @@ void OSQLParseNode::showParseTree( OUStringBuffer& _inout_rBuffer, sal_uInt32 nL case SQL_NODE_KEYWORD: _inout_rBuffer.appendAscii( "SQL_KEYWORD: " ); - _inout_rBuffer.append( OUString::fromUtf8( OSQLParser::TokenIDToStr( getTokenID() ) ) ); + _inout_rBuffer.append( OStringToOUString( OSQLParser::TokenIDToStr( getTokenID() ), RTL_TEXTENCODING_UTF8 ) ); _inout_rBuffer.append( '\n' ); break; @@ -2442,7 +2442,7 @@ void OSQLParseNode::parseLeaf(OUStringBuffer& rString, const SQLParseNodeParamet rString.appendAscii(" "); const OString sT = OSQLParser::TokenIDToStr(m_nNodeID, rParam.bInternational ? &rParam.m_rContext : NULL); - rString.append(OUString::fromUtf8(sT)); + rString.append(OStringToOUString(sT,RTL_TEXTENCODING_UTF8)); } break; case SQL_NODE_STRING: if (!rString.isEmpty()) |