From ff61237356f2a7dd43aaa93ccb143b6565e5c131 Mon Sep 17 00:00:00 2001 From: Alex Dupre Date: Fri, 23 Dec 2005 07:02:12 +0000 Subject: Do not hardcode charset, honour charset defined in freetds.conf or php.ini. --- databases/php5-mssql/files/patch-php_mssql.c | 23 +++++++++++++++++++++++ databases/php5-mssql/files/patch-php_mssql.h | 12 ++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 databases/php5-mssql/files/patch-php_mssql.c create mode 100644 databases/php5-mssql/files/patch-php_mssql.h (limited to 'databases/php5-mssql') diff --git a/databases/php5-mssql/files/patch-php_mssql.c b/databases/php5-mssql/files/patch-php_mssql.c new file mode 100644 index 000000000000..73eaa6a30057 --- /dev/null +++ b/databases/php5-mssql/files/patch-php_mssql.c @@ -0,0 +1,23 @@ +--- php_mssql.c 2005/12/06 18:47:14 1.152.2.10 ++++ php_mssql.c 2005/12/21 22:43:06 1.152.2.11 +@@ -141,6 +141,9 @@ + STD_PHP_INI_BOOLEAN("mssql.datetimeconvert", "1", PHP_INI_ALL, OnUpdateBool, datetimeconvert, zend_mssql_globals, mssql_globals) + STD_PHP_INI_BOOLEAN("mssql.secure_connection", "0", PHP_INI_SYSTEM, OnUpdateBool, secure_connection, zend_mssql_globals, mssql_globals) + STD_PHP_INI_ENTRY_EX("mssql.max_procs", "-1", PHP_INI_ALL, OnUpdateLong, max_procs, zend_mssql_globals, mssql_globals, display_link_numbers) ++#ifdef HAVE_FREETDS ++ STD_PHP_INI_ENTRY("mssql.charset", "", PHP_INI_ALL, OnUpdateString, charset, zend_mssql_globals, mssql_globals) ++#endif + PHP_INI_END() + + /* error handler */ +@@ -495,7 +498,9 @@ + #endif + + #ifdef HAVE_FREETDS +- DBSETLCHARSET(mssql.login, "ISO-8859-1"); ++ if (MS_SQL_G(charset) && strlen(MS_SQL_G(charset))) { ++ DBSETLCHARSET(mssql.login, MS_SQL_G(charset)); ++ } + #endif + + DBSETLAPP(mssql.login,MS_SQL_G(appname)); diff --git a/databases/php5-mssql/files/patch-php_mssql.h b/databases/php5-mssql/files/patch-php_mssql.h new file mode 100644 index 000000000000..d8aefeadb1a0 --- /dev/null +++ b/databases/php5-mssql/files/patch-php_mssql.h @@ -0,0 +1,12 @@ +--- php_mssql.h 2005/12/06 01:25:16 1.42.2.1 ++++ php_mssql.h 2005/12/21 22:43:06 1.42.2.2 +@@ -158,6 +158,9 @@ + zend_bool allow_persistent; + char *appname; + char *server_message; ++#ifdef HAVE_FREETDS ++ char *charset; ++#endif + long min_error_severity, min_message_severity; + long cfg_min_error_severity, cfg_min_message_severity; + long connect_timeout, timeout; -- cgit v1.2.3