Victor Sudakov написал(а) к Eugene Grosbein в Sep 17 20:16:28 по местному времени:
Dear Eugene,
12 Sep 17 15:03, you wrote to me:
VS>> На тех сайтах, с которыми я сейчас разбираюсь, вебмастер широко
VS>> использует функцию mysql
setcharset(), в каком-то таком виде if
VS>> ($this->link = @mysql_connect($host, $user, $pass, 1)) {
VS>> mysql
setcharset('cp1251', $this->link);
VS>> ... }
VS>> Видимо она и влияет на charset в handshake. Но какой выбирается
VS>> charset, если эту функцию не использовать - я нигде даже
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
VS>> нагуглить не смог.
EG>
https://dev.mysql.com/doc/refman/5.7...acter-set.html
EG> 27.8.7.67 mysql
set_characterset()
EG> This function is used to set the default character set for the current
EG> connection. The string csname specifies a valid character set name.
EG> The connection collation becomes the default collation of the
EG> character set. This function works like the SET NAMES statement, but
EG> also sets the value of mysql->charset, and thus affects the character
EG> set used by mysql
real_escapestring()
EG>
https://dev.mysql.com/doc/refman/5.7/en/set-names.html
EG> SET NAMES {'charset
name' [COLLATE 'collationname'] | DEFAULT}
EG> This statement sets the three session system variables
EG> character
set_client, character_setconnection, and
EG> character
setresults to the given character set. Setting
EG> character
set_connection to charsetname also
EG> sets collation_connection to the default collation for
EG> charset_name. See Section 10.1.4, Connection Character Sets and
EG> Collations.
В процитированном не говорится, какой и откуда берется charset, если все эти mysql
set_charset() и mysql_set_characterset() не использовать в коде вообще никак.
EG> Ну и далее
EG>
https://dev.mysql.com/doc/refman/5.7...onnection.html
Если там далее ответ на мой вопрос всё-таки есть, ты бы лучше ответ и процитировал.
Victor Sudakov, VAS4-RIPE, VAS47-RIPN
--- GoldED+/BSD 1.1.5-b20160322-b20160322