Changed flag name
This commit is contained in:
parent
e031c1a3fa
commit
9d9acc3627
|
@ -1808,7 +1808,7 @@ struct sqlsrv_buffered_result_set : public sqlsrv_result_set {
|
|||
bool convert_string_from_utf16_inplace( _In_ SQLSRV_ENCODING encoding, _Inout_updates_z_(len) char** string, _Inout_ SQLLEN& len);
|
||||
bool validate_string( _In_ char* string, _In_ SQLLEN& len);
|
||||
bool convert_string_from_utf16( _In_ SQLSRV_ENCODING encoding, _In_reads_bytes_(cchInLen) const SQLWCHAR* inString, _In_ SQLINTEGER cchInLen, _Inout_updates_bytes_(cchOutLen) char** outString, _Out_ SQLLEN& cchOutLen );
|
||||
SQLWCHAR* utf16_string_from_mbcs_string( _In_ SQLSRV_ENCODING php_encoding, _In_reads_bytes_(mbcs_len) const char* mbcs_string, _In_ unsigned int mbcs_len, _Out_ unsigned int* utf16_len, bool is_connection_string = false );
|
||||
SQLWCHAR* utf16_string_from_mbcs_string( _In_ SQLSRV_ENCODING php_encoding, _In_reads_bytes_(mbcs_len) const char* mbcs_string, _In_ unsigned int mbcs_len, _Out_ unsigned int* utf16_len, bool use_strict_conversion = false );
|
||||
|
||||
//*********************************************************************************************************************************
|
||||
// Error handling routines and Predefined Errors
|
||||
|
|
|
@ -34,7 +34,7 @@ char last_err_msg[2048] = {'\0'}; // 2k to hold the error messages
|
|||
unsigned int convert_string_from_default_encoding( _In_ unsigned int php_encoding, _In_reads_bytes_(mbcs_len) char const* mbcs_in_string,
|
||||
_In_ unsigned int mbcs_len,
|
||||
_Out_writes_(utf16_len) __transfer( mbcs_in_string ) SQLWCHAR* utf16_out_string,
|
||||
_In_ unsigned int utf16_len, bool is_connection_string = false );
|
||||
_In_ unsigned int utf16_len, bool use_strict_conversion = false );
|
||||
}
|
||||
|
||||
// SQLSTATE for all internal errors
|
||||
|
@ -172,11 +172,11 @@ bool convert_string_from_utf16( _In_ SQLSRV_ENCODING encoding, _In_reads_bytes_(
|
|||
// allocation of the destination string. An empty string passed in returns
|
||||
// failure since it's a failure case for convert_string_from_default_encoding.
|
||||
SQLWCHAR* utf16_string_from_mbcs_string( _In_ SQLSRV_ENCODING php_encoding, _In_reads_bytes_(mbcs_len) const char* mbcs_string, _In_ unsigned int mbcs_len,
|
||||
_Out_ unsigned int* utf16_len, bool is_connection_string )
|
||||
_Out_ unsigned int* utf16_len, bool use_strict_conversion )
|
||||
{
|
||||
*utf16_len = (mbcs_len + 1);
|
||||
SQLWCHAR* utf16_string = reinterpret_cast<SQLWCHAR*>( sqlsrv_malloc( *utf16_len * sizeof( SQLWCHAR )));
|
||||
*utf16_len = convert_string_from_default_encoding( php_encoding, mbcs_string, mbcs_len, utf16_string, *utf16_len, is_connection_string );
|
||||
*utf16_len = convert_string_from_default_encoding( php_encoding, mbcs_string, mbcs_len, utf16_string, *utf16_len, use_strict_conversion );
|
||||
|
||||
if( *utf16_len == 0 ) {
|
||||
// we preserve the error and reset it because sqlsrv_free resets the last error
|
||||
|
@ -384,7 +384,7 @@ namespace {
|
|||
// to convert.
|
||||
unsigned int convert_string_from_default_encoding( _In_ unsigned int php_encoding, _In_reads_bytes_(mbcs_len) char const* mbcs_in_string,
|
||||
_In_ unsigned int mbcs_len, _Out_writes_(utf16_len) __transfer( mbcs_in_string ) SQLWCHAR* utf16_out_string,
|
||||
_In_ unsigned int utf16_len, bool is_connection_string )
|
||||
_In_ unsigned int utf16_len, bool use_strict_conversion )
|
||||
{
|
||||
unsigned int win_encoding = CP_ACP;
|
||||
switch( php_encoding ) {
|
||||
|
@ -401,7 +401,7 @@ unsigned int convert_string_from_default_encoding( _In_ unsigned int php_encodin
|
|||
}
|
||||
#ifndef _WIN32
|
||||
unsigned int required_len;
|
||||
if (is_connection_string) {
|
||||
if (use_strict_conversion) {
|
||||
required_len = SystemLocale::ToUtf16Strict( win_encoding, mbcs_in_string, mbcs_len, utf16_out_string, utf16_len );
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -214,12 +214,12 @@ bool ss_error_handler( _Inout_ sqlsrv_context& ctx, _In_ unsigned int sqlsrv_err
|
|||
// returned in utf16_out_string.
|
||||
unsigned int convert_string_from_default_encoding( _In_ unsigned int php_encoding, _In_reads_bytes_(mbcs_len) char const* mbcs_in_string,
|
||||
_In_ unsigned int mbcs_len, _Out_writes_(utf16_len) __transfer(mbcs_in_string) wchar_t* utf16_out_string,
|
||||
_In_ unsigned int utf16_len, bool is_connection_string = false );
|
||||
_In_ unsigned int utf16_len, bool use_strict_conversion = false );
|
||||
// create a wide char string from the passed in mbcs string. NULL is returned if the string
|
||||
// could not be created. No error is posted by this function. utf16_len is the number of
|
||||
// wchar_t characters, not the number of bytes.
|
||||
SQLWCHAR* utf16_string_from_mbcs_string( _In_ unsigned int php_encoding, _In_reads_bytes_(mbcs_len) const char* mbcs_string,
|
||||
_In_ unsigned int mbcs_len, _Out_ unsigned int* utf16_len, bool is_connection_string = false );
|
||||
_In_ unsigned int mbcs_len, _Out_ unsigned int* utf16_len, bool use_strict_conversion = false );
|
||||
|
||||
// *** internal error macros and functions ***
|
||||
bool handle_error( sqlsrv_context const* ctx, int log_subsystem, const char* function,
|
||||
|
|
Loading…
Reference in a new issue