summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/postgresql
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-11-06 17:24:13 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-11-06 17:24:13 +0100
commitfc0d57b7aff84f4bdca0a1f201527c265d5f0cf5 (patch)
tree49a72b76d2d2a92af6371748c19277778159b86d /connectivity/source/drivers/postgresql
parente36dae401fc8963c9a92cb2c11d9b650b943c6d3 (diff)
Revert "use the new OUString::fromUtf8 method"
This reverts commit 05050cdb23de586870bf479a9df5ced06828d498, not all places that use e.g. OStringToOUString to convert potential UTF-8 are guaranteed to fulfil the prerequisites necessary to use fromUtf8 (and some places like e.g. in codemaker are happy with the best-effort effect of OStringToOUString's OSTRING_TO_OUSTRING_CVTFLAGS).
Diffstat (limited to 'connectivity/source/drivers/postgresql')
-rw-r--r--connectivity/source/drivers/postgresql/pq_tools.cxx13
1 files changed, 8 insertions, 5 deletions
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);
}