pike.git/
lib/
modules/
Sql.pmod/
mysql.pike
Branch:
Tag:
Non-build tags
All tags
No tags
2006-12-05
2006-12-05 11:48:21 by Henrik Grubbström (Grubba) <grubba@grubba.org>
55a42c6048146c6e620d27846b238f9e6e0d2598 (
27
lines) (+
9
/-
18
)
[
Show
|
Annotate
]
Branch:
7.6
Got rid of circularity.
Rev: lib/modules/Sql.pmod/mysql.pike:1.31
1:
/*
-
* $Id: mysql.pike,v 1.
30
2006/12/
03
16
:
47
:
20
nilsson
Exp $
+
* $Id: mysql.pike,v 1.
31
2006/12/
05
11
:
48
:
21
grubba
Exp $
* * Glue for the Mysql-module */
136:
return !!send_charset; }
-
#if constant (Mysql.mysql.HAVE_MYSQL_FIELD_CHARSETNR)
+
void set_unicode_decode_mode (int enable)
-
#else
-
//! @ignore
-
static void broken_set_unicode_decode_mode (int enable)
-
//! @endignore
-
#endif
+
//! Enable or disable unicode decode mode. //! //! In this mode, if the server supports UTF-8 then non-binary text
164:
//! //! @note //! This function is only available if Pike has been compiled with
-
//! MySQL client library 4.1.0 or later.
+
//! MySQL client library 4.1.0 or later
, or if the environment
+
//! variable @tt{PIKE_BROKEN_MYSQL_UNICODE_MODE@} is set
.
//! //! @seealso //! @[set_unicode_encode_mode] {
-
+
#if !constant (Mysql.mysql.HAVE_MYSQL_FIELD_CHARSETNR)
+
if (!getenv("PIKE_BROKEN_MYSQL_UNICODE_MODE")) {
+
predef::error("set_unicode_decode_mode not available.\n");
+
}
+
#endif
if (enable) { CH_DEBUG("Enabling unicode decode mode.\n"); ::big_query ("SET character_set_results = utf8");
181:
} }
-
#if !constant (Mysql.mysql.HAVE_MYSQL_FIELD_CHARSETNR)
-
// See blurb at MySQLBrokenUnicodeWrapper in sql_util.pmod. The
-
// PIKE_BROKEN_MYSQL_UNICODE_MODE thingy ought to be a define, but
-
// it's an environment variable instead to avoid problems with
-
// overcaching in dumped files.
-
function(int:void) set_unicode_decode_mode =
-
getenv ("PIKE_BROKEN_MYSQL_UNICODE_MODE") &&
-
broken_set_unicode_decode_mode;
-
#endif
-
+
int get_unicode_decode_mode() //! Returns nonzero if unicode decode mode is enabled, zero otherwise. //!