[TYPO3-english] Migrating PHP 5.2.17 > 5.3.8 changes MySQL connection encoding

David ARNOULT - Edition & Internet Operations d.arnoult at topsolid.com
Thu Sep 8 16:25:15 CEST 2011


Hi folks!

 

I am running smoothly TYPO3 4.5.5 (created with 4.2) on PHP 5.2.17/MySQL
5.1/Apache2.2.19 on Windows 2003 R2.

 

When I try to simply switch PHP 5.2.17 to 5.3.8, all characters encoding
changes in FE for all my PHP applications (not only TYPO3, PHPBB etc): I
have “Mécanique générale” instead of “Mécanique générale”. 

PHP, MySQL and TYPO3 settings are strictly identical but connection to MySQL
seems to work differently: PHP 5.3 does not convert but display the true
value stored in MySQL. Effectively, when editing my table with phpmyadmin,
tables are all in utf8_general_ci  and my strings are all stored in “false”
UTF-8 (Mécanique générale instead of Mécanique générale, Nouveauté
instead of Nouveautés etc) but by “magic” with PHP 5.2.17 it is working fine
in BE and FE!

 

One thing to know: this value must be empty to make conversion working:

$TYPO3_CONF_VARS['SYS']['setDBinit'] = '';

 

This is a report done with sm_charsethelper:


MySQL character sets and collations (magic conversion settings working with
PHP 5.2.17)


MySQL general information

Version

5.1.40-community

MySQL Character Sets

character_set_client

latin1

character_set_connection

latin1

character_set_database

utf8

character_set_filesystem

binary

character_set_results

latin1

character_set_server

utf8

character_set_system

utf8

character_sets_dir

C:\Program Files\MySQL\MySQL Server 5.1\share\charsets\

MySQL Collation

collation_connection

latin1_swedish_ci

collation_database

utf8_general_ci

collation_server

utf8_unicode_ci

 

Questions:

 

1/ What would you recommend in this situation? Is PHP 5.3 vital for TYPO3
4.5? 

 

2/Can I continue safely to work in these conditions, especially in the
future with TYPO3 4.6?

 

3/If not, is there a way to use PHP 5.3 and keeping this “magic” conversion?

 

4/If not, how to convert my strings in true UTF-8 knowing that first method
of Jigal van Hemert described here did not work for me: 

http://wiki.typo3.org/UTF-8_support

 

The only solution I have found is to get a dump of concerned tables (pages,
pages_languages_overlay
), open it in Notepad+, convert it in UTF-8 and
import it back in MySQL
 Files are huge but it works. Isn’t there a better
solution, like an online one with phpmyadmin?

 

Any help will be appreciated.

 

Thanks!

 

David



More information about the TYPO3-english mailing list