Показать сообщение отдельно
  #25  
Старый 12.09.2017, 17:38
Victor Sudakov
Guest
 
Сообщений: n/a
По умолчанию mysqldump и кодировка

Victor Sudakov написал(а) к Eugene Grosbein в Sep 17 20:16:28 по местному времени:

Dear Eugene,

12 Sep 17 15:03, you wrote to me:

VS>> На тех сайтах, с которыми я сейчас разбираюсь, вебмастер широко
VS>> использует функцию mysqlsetcharset(), в каком-то таком виде if
VS>> ($this->link = @mysql_connect($host, $user, $pass, 1)) {
VS>> mysqlsetcharset('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 mysqlset_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 mysqlreal_escapestring()

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

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

EG> This statement sets the three session system variables
EG> characterset_client, character_setconnection, and
EG> charactersetresults to the given character set. Setting
EG> characterset_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, если все эти mysqlset_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
Ответить с цитированием