Extracted from Pike v7.6 release 112 at 2010-04-06.
pike.ida.liu.se
[Top]
Sql
Sql.mysql

Method Sql.mysql()->set_unicode_decode_mode()


Method set_unicode_decode_mode

void set_unicode_decode_mode(int enable)

Description

Enable or disable unicode decode mode.

In this mode, if the server supports UTF-8 then non-binary text strings in results are automatically decoded to (possibly wide) unicode strings. Not enabled by default.

The statement "SET character_set_results = utf8" is sent to the server to enable the mode. When the mode is disabled, "SET character_set_results = xxx" is sent, where xxx is the connection charset that get_charset returns.

Parameter enable

Nonzero enables this feature, zero disables it.

Throws

Throws an exception if the server doesn't support this, i.e. if the statement above fails. The MySQL system variable character_set_results was added in MySQL 4.1.1.

Note

This function is only available if Pike has been compiled with MySQL client library 4.1.0 or later, or if the environment variable PIKE_BROKEN_MYSQL_UNICODE_MODE is set.

See also

set_unicode_encode_mode