Показать сообщение отдельно
  #24  
Старый 12.09.2017, 12:30
Eugene Grosbein
Guest
 
Сообщений: n/a
По умолчанию Re: mysqldump и кодировка

Eugene Grosbein написал(а) к Victor Sudakov в Sep 17 15:03:46 по местному времени:

11 сент. 2017, понедельник, в 10:42 NOVT, Victor Sudakov написал(а):

VS> На тех сайтах, с которыми я сейчас разбираюсь, вебмастер широко использует
VS> функцию mysqlsetcharset(), в каком-то таком виде
VS> if ($this->link = @mysql_connect($host, $user, $pass, 1)) {
VS> mysqlsetcharset('cp1251', $this->link);
VS> ... }
VS> Видимо она и влияет на charset в handshake. Но какой выбирается charset, если
VS> эту функцию не использовать - я нигде даже нагуглить не смог.

https://dev.mysql.com/doc/refman/5.7...acter-set.html

27.8.7.67 mysqlset_characterset()

This function is used to set the default character set for the current
connection. The string csname specifies a valid character set name.
The connection collation becomes the default collation of the character set.
This function works like the SET NAMES statement, but also sets the value
of mysql->charset, and thus affects the character set used
by mysqlreal_escapestring()

https://dev.mysql.com/doc/refman/5.7/en/set-names.html

SET NAMES {'charsetname' [COLLATE 'collationname'] | DEFAULT}

This statement sets the three session system variables charactersetclient,
characterset_connection, and character_setresults to the given character set.
Setting characterset_connection to charsetname also sets
collationconnection to the default collation for charsetname.
See Section 10.1.4, Connection Character Sets and Collations.

Ну и далее https://dev.mysql.com/doc/refman/5.7...onnection.html

Eugene
--- slrn/1.0.2 (FreeBSD)
Ответить с цитированием