Re: [PHP-DEV] mysql_set_charset
On Thu, Aug 7, 2008 at 6:29 PM, Hannes Magnusson <[EMAIL PROTECTED]> wrote: > On Thu, Aug 7, 2008 at 16:17, Ulf Wendel <[EMAIL PROTECTED]> wrote: >> He explained to me that using SET NAMES is what is not recommended when >> using libmysql because: >> >> - there is no verification if the client knows the charset >> - the internal mysql->charset field will not be set properly > > Is this something we should add to the mysql[i]_set_charset() docs? > I've seen *bunch* of people doing mysql[i]_query("SET NAMES UTF8");... Is it possible to add similiar functionality to pdo_mysql? Probably in the form of custom option. -- Alexey Zakhlestin http://blog.milkfarmsoft.com/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] mysql_set_charset
On 07.08.2008, at 16:29, Hannes Magnusson wrote: On Thu, Aug 7, 2008 at 16:17, Ulf Wendel <[EMAIL PROTECTED]> wrote: He explained to me that using SET NAMES is what is not recommended when using libmysql because: - there is no verification if the client knows the charset - the internal mysql->charset field will not be set properly Is this something we should add to the mysql[i]_set_charset() docs? I've seen *bunch* of people doing mysql[i]_query("SET NAMES UTF8");... yes .. most people do it for historical reasons, or because they did not want to clutter their libraries with function_exists() calls. regards, Lukas Kahwe Smith [EMAIL PROTECTED] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] mysql_set_charset
Hannes Magnusson wrote: On Thu, Aug 7, 2008 at 16:17, Ulf Wendel <[EMAIL PROTECTED]> wrote: He explained to me that using SET NAMES is what is not recommended when using libmysql because: - there is no verification if the client knows the charset - the internal mysql->charset field will not be set properly Is this something we should add to the mysql[i]_set_charset() docs? I've seen *bunch* of people doing mysql[i]_query("SET NAMES UTF8");... -Hannes The people doing it usually have to support PHP versions lower than 5.2.3, we use SET NAMES on older versions of PHP. Scott -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] mysql_set_charset
On Thu, Aug 7, 2008 at 16:17, Ulf Wendel <[EMAIL PROTECTED]> wrote: > He explained to me that using SET NAMES is what is not recommended when > using libmysql because: > > - there is no verification if the client knows the charset > - the internal mysql->charset field will not be set properly Is this something we should add to the mysql[i]_set_charset() docs? I've seen *bunch* of people doing mysql[i]_query("SET NAMES UTF8");... -Hannes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] mysql_set_charset
Ulf Wendel schrieb: I don't recall why I added "usage not recommended" to the test. Let me check with Georg. He had some concerns on the function as far as I remember. I checked with Georg. My memories regarding Georg's position are totally wrong. He once introduced mysql_set_charset to the MySQL Client Library (AKA "libmysql" - marketing gets confused when I use libmysql, sorry). He explained to me that using SET NAMES is what is not recommended when using libmysql because: - there is no verification if the client knows the charset - the internal mysql->charset field will not be set properly I don't know how that "usage not recommended" comment has crept in the test. Probably my fault... Ulf -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] mysql_set_charset
Hi! There it is http://news.php.net/php.cvs/52063 Thanks! -- Stanislav Malyshev, Zend Software Architect [EMAIL PROTECTED] http://www.zend.com/ (408)253-8829 MSN: [EMAIL PROTECTED] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] mysql_set_charset
Ulf Wendel schrieb: and its in HEAD. Andrey is working on re-introducing it to ext/mysql in the 5_3 branch. There it is http://news.php.net/php.cvs/52063 Ulf -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] mysql_set_charset
Stanislav Malyshev schrieb: I notice that mysql_set_charset function is not part of 5.3 tree and it's test is marked as "usage not recommended". Could you explain what is the reason for that? It's quite unusual to drop functions in later versions, and if mysql_set_charset() has some problem we should note that in the manual. Hi Stas, good find! I think it has happened accidently in 5_3 at Revision 1.213.2.6.2.16.2.2 when patching ext/mysql for mysqlnd some 10 months ago [1] . Its in 5_2 and its in HEAD. Andrey is working on re-introducing it to ext/mysql in the 5_3 branch. I don't recall why I added "usage not recommended" to the test. Let me check with Georg. He had some concerns on the function as far as I remember. Ulf [1] http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql.c?r1=1.213.2.6.2.16.2.1&r2=1.213.2.6.2.16.2.2 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php