Hello internals,
Attached is a patch against PHP_4_4 allowing to specify a charset when
talking to MySQL using ext/mysql and client libraries that come with
MySQL >= 4.1.13 (the default being utf8).
This was mainly tested with latin1. To test, add an ini entry like this:
mysql.default_charset = "latin1"
Any constructive comments on the patch would be appreciated.
Sincerely,
Olivier
Hello internals,
Attached is a patch against PHP_4_4 allowing to specify a charset when
talking to MySQL using ext/mysql and client libraries that come with
MySQL >= 4.1.13 (the default being utf8).This was mainly tested with latin1. To test, add an ini entry like this:
mysql.default_charset = "latin1"
Any constructive comments on the patch would be appreciated.
IIRC such patch has been already discussed and rejected.
Also, PHP 4.x is bugfix branch and NO new features will be added there.
In 5.x there is ext/mysqli, which have much more functionality than ext/mysql and you should be using it instead.
--
Wbr,
Antony Dovgal
Hello Antony,
I've realized 5 minutes after posting that I would receive an answer like this.
I am aware that this is a bugfix only branch, but for us this was a
bug. We were moving to new servers compiled against MySQL 4.1 libs and
not the bundled ones with PHP. With this move, things got from latin1
to utf8 and since PHP 4 doesn't really care about Unicode, we had to
come up with this fix. Looking at the comments in the docs on php.net,
we were not the only one with this problem. [1]
I do not really care it the patch makes it to the core, I just wanted
to post it so other people having to deal with PHP4 and newer MySQL
versions can use this trick. In our case, MySQLi wasn't an option. We
will be upgrading to PHP5 shortly on our production servers, but in
the meantime this is an easy fix.
Sincerely,
Olivier
[1] http://ca.php.net/manual/en/function.mysql-client-encoding.php
Hello internals,
Attached is a patch against PHP_4_4 allowing to specify a charset when
talking to MySQL using ext/mysql and client libraries that come with
MySQL >= 4.1.13 (the default being utf8).This was mainly tested with latin1. To test, add an ini entry like this:
mysql.default_charset = "latin1"
Any constructive comments on the patch would be appreciated.
IIRC such patch has been already discussed and rejected.
Also, PHP 4.x is bugfix branch and NO new features will be added there.
In 5.x there is ext/mysqli, which have much more functionality than ext/mysql and you should be using it instead.--
Wbr,
Antony Dovgal
Am Do, den 06.07.2006 schrieb Olivier Hill um 18:01:
I am aware that this is a bugfix only branch, but for us this was a
bug. We were moving to new servers compiled against MySQL 4.1 libs and
not the bundled ones with PHP. With this move, things got from latin1
to utf8 and since PHP 4 doesn't really care about Unicode, we had to
come up with this fix. Looking at the comments in the docs on php.net,
we were not the only one with this problem. [1]
"Official" MySQL binaries have latin1 character set by default, not
utf8. Afaik only gentoo distribution delivers packages with default
utf8.
/Georg