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:08 by Henrik Grubbström (Grubba) <grubba@grubba.org>
84813ca811c863689c837818a44be9ef49d2af93 (
25
lines) (+
9
/-
16
)
[
Show
|
Annotate
]
Branch:
7.4
Got rid of circularity.
Rev: lib/modules/Sql.pmod/mysql.pike:1.25
1:
/*
-
* $Id: mysql.pike,v 1.
24
2006/
11
/
27
16
:
28
:
39
mast
Exp $
+
* $Id: mysql.pike,v 1.
25
2006/
12
/
05
11
:
48
:
08
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
-
static void broken_set_unicode_decode_mode (int enable)
-
#endif
+
//! Enable or disable unicode decode mode. //! //! In this mode, if the server supports UTF-8 then non-binary text
162:
//! //! @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");
179:
} }
-
#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. //!