Extracted from Pike v7.6 release 93 at 2006-10-04.
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 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 mode is not compatible with earlier pike versions. You need to run in compatibility mode <= 7.6 to have it disabled by default.

See also

set_unicode_encode_mode