Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,492
    Plugin Contributions
    88

    Default *[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);

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default 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.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,492
    Plugin Contributions
    88

    Default 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.

 

 

Similar Threads

  1. Replies: 0
    Last Post: 7 Jul 2016, 08:20 PM
  2. Replies: 4
    Last Post: 2 Dec 2013, 07:43 PM
  3. v150 2007 technique for converting a latin1 table to utf8
    By boxes in forum Upgrading to 1.5.x
    Replies: 1
    Last Post: 23 Jul 2012, 12:06 AM
  4. To Upgrade or Install fresh?
    By Decostyle in forum Upgrading from 1.3.x to 1.3.9
    Replies: 4
    Last Post: 28 Apr 2010, 06:16 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR