*[Done v1.6.0] Fresh install or upgrade using Latin1 still results in utf8
If you perform a fresh install of v1.5.1 (or v1.5.0) into an empty database created using latin1_general_ci collation and select "Latin1" as the database collation type during the install, the resulting database uses only utf8_general_ci collation. If you perform an upgrade of a pre-v1.5.0 database that uses latin1 collation and select "Latin1" as the database collation type, the new admin-related database tables are created using utf8_general_ci collation.
Don't get me wrong, I'm in the process of converting all my sites to use utf8 ... but if a feature is provided it should work properly.
The problem is in the file /zc_install/includes/installer_params.php:
Code:
<?php
/**
* @package Installer
* @access private
* @copyright Copyright 2003-2011 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: installer_params.php 18819 2011-05-31 20:25:53Z drbyte $
*/
/**
* Runtime Parameters used by browser interface
*/
// $session_save_path = (@ini_get('session.save_path') && is_writable(ini_get('session.save_path')) ) ? ini_get('session.save_path') : realpath('../cache');
$session_save_path = (is_writable(realpath('../cache')) ) ? realpath('../cache') : ini_get('session.save_path');
define('SESSION_WRITE_DIRECTORY', $session_save_path);
define('DEBUG_LOG_FOLDER', realpath('../cache'));
// Set the following to TRUE if having problems (blank pages, etc). Best to leave at FALSE for normal use.
define('STRICT_ERROR_REPORTING', FALSE);
// optionally set this to 'latin1':
define('DB_CHARSET', 'utf8');
// optionally uncomment the following line if choosing 'utf8' or 'latin1' above are causing problems:
// define('IGNORE_DB_CHARSET', TRUE);
The DB_CHARSET define is used by the CREATE_TABLE clause of the select statement of the executeSQL function within /zc_install/includes/functions/general.php and is set (if not already defined) by the dbActivate function within /zc_install/includes/classes/installer.php to reflect the value specified by the drop-down box within the Database Configuration step of the install.
The problem is that DB_CHARSET is already defined during the inclusion of the installer_parms.php file ... the net result being that a fresh install of v1.5.1 or v1.5.0 ALWAYS uses a utf8_general_ci collation regardless of the value chosen by the user during the install.
The fix is to simply comment out the define statement in the installer_parms.php file:
Code:
<?php
/**
* @package Installer
* @access private
* @copyright Copyright 2003-2011 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: installer_params.php 18819 2011-05-31 20:25:53Z drbyte $
*/
/**
* Runtime Parameters used by browser interface
*/
// $session_save_path = (@ini_get('session.save_path') && is_writable(ini_get('session.save_path')) ) ? ini_get('session.save_path') : realpath('../cache');
$session_save_path = (is_writable(realpath('../cache')) ) ? realpath('../cache') : ini_get('session.save_path');
define('SESSION_WRITE_DIRECTORY', $session_save_path);
define('DEBUG_LOG_FOLDER', realpath('../cache'));
// Set the following to TRUE if having problems (blank pages, etc). Best to leave at FALSE for normal use.
define('STRICT_ERROR_REPORTING', FALSE);
// optionally set this to 'latin1':
// define('DB_CHARSET', 'utf8');
// optionally uncomment the following line if choosing 'utf8' or 'latin1' above are causing problems:
// define('IGNORE_DB_CHARSET', TRUE);
Re: Fresh install or upgrade using Latin1 still results in utf8
lat9, you had posted the same thing already at: http://www.zen-cart.com/showthread.p...29#post1143929
It was slated to be commented out in v1.5.1.
But, a mistake was made between pre-release testing of v1.5.1 and preparation of the final commits ... and the line you suggested being commented out got uncommented.
It will be commented out again in the next release. Apologies for the oversight. :blush:
Re: Fresh install or upgrade using Latin1 still results in utf8
DrByte, apologies for the additional post; I thought that since it wasn't posted/moved to the bug reports area that it was being ignored. Next time, I'll ask in the initial thread before re-posting.